2005-06-06 13:00:52 +00:00
|
|
|
|
; Lyx for Windows, NSIS v2 series installer script
|
|
|
|
|
|
|
|
|
|
; File lyx_installer.nsi
|
|
|
|
|
; This file is part of LyX, the document processor.
|
|
|
|
|
; http://www.lyx.org/
|
|
|
|
|
; Licence details can be found in the file COPYING or copy at
|
|
|
|
|
; http://www.lyx.org/about/license.php3
|
|
|
|
|
|
|
|
|
|
; Author Angus Leeming
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Author Uwe St<53>hr
|
2005-06-06 13:00:52 +00:00
|
|
|
|
; Full author contact details are available in file CREDITS or copy at
|
|
|
|
|
; http://www.lyx.org/about/credits.php
|
|
|
|
|
|
|
|
|
|
; This script requires NSIS 2.06 and above
|
|
|
|
|
; http://nsis.sourceforge.net/
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
; Do a Cyclic Redundancy Check to make sure the installer
|
|
|
|
|
; was not corrupted by the download.
|
|
|
|
|
CRCCheck force
|
|
|
|
|
|
|
|
|
|
; Make the installer as small as possible.
|
2005-06-09 11:48:43 +00:00
|
|
|
|
SetCompressor lzma
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
; You should need to change only these macros...
|
|
|
|
|
|
|
|
|
|
!define PRODUCT_NAME "LyX"
|
2006-03-02 19:14:09 +00:00
|
|
|
|
!define PRODUCT_VERSION "1.4.0"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!define PRODUCT_LICENSE_FILE "..\..\..\..\COPYING"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!define PRODUCT_SOURCEDIR "..\..\..\..\build\installprefix"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!define PRODUCT_EXE "$INSTDIR\bin\lyx.exe"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!define PRODUCT_BAT "$INSTDIR\bin\lyx.bat"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!define PRODUCT_EXT ".lyx"
|
|
|
|
|
!define PRODUCT_MIME_TYPE "application/lyx"
|
|
|
|
|
!define PRODUCT_UNINSTALL_EXE "$INSTDIR\uninstall.exe"
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
!define INSTALLER_EXE "lyx_setup_140.exe"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!define INSTALLER_ICON "..\icons\lyx_32x32.ico"
|
|
|
|
|
|
|
|
|
|
; Replaced by HKLM or HKCU depending on SetShellVarContext.
|
|
|
|
|
!define PRODUCT_ROOT_KEY "SHCTX"
|
|
|
|
|
|
|
|
|
|
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\lyx.exe"
|
|
|
|
|
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
; Make some of the information above available to NSIS.
|
|
|
|
|
|
|
|
|
|
Name "${PRODUCT_NAME}"
|
|
|
|
|
OutFile "${INSTALLER_EXE}"
|
|
|
|
|
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
!include "MUI.nsh"
|
|
|
|
|
!include "LogicLib.nsh"
|
|
|
|
|
!include "StrFunc.nsh"
|
|
|
|
|
!include "strtrim.nsh"
|
|
|
|
|
!include "download.nsh"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!include "lyx_utils.nsh"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Grabbed from
|
|
|
|
|
; http://nsis.sourceforge.net/archive/viewpage.php?pageid=275
|
|
|
|
|
!include "is_user_admin.nsh"
|
|
|
|
|
|
|
|
|
|
; Grabbed from
|
|
|
|
|
; http://abiword.pchasm.org/source/cvs/abiword-cvs/abi/src/pkg/win/setup/NSISv2/abi_util_fileassoc.nsh
|
|
|
|
|
; Use the Abiword macros to help set up associations with the file extension.
|
|
|
|
|
; in the Registry.
|
|
|
|
|
!include "abi_util_fileassoc.nsh"
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
2005-06-06 13:00:52 +00:00
|
|
|
|
; Declare used functions
|
2005-07-15 10:05:13 +00:00
|
|
|
|
|
|
|
|
|
${StrStrAdv}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${StrLoc}
|
2005-06-14 16:45:46 +00:00
|
|
|
|
${StrNSISToIO}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${StrRep}
|
2005-07-15 10:05:13 +00:00
|
|
|
|
${StrTok}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${StrTrim}
|
2005-06-14 16:45:46 +00:00
|
|
|
|
${StrLTrim}
|
|
|
|
|
${StrRTrim}
|
|
|
|
|
${StrRTrimChar}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${ReadDownloadValues}
|
|
|
|
|
${EnableBrowseControls}
|
2005-06-14 16:45:46 +00:00
|
|
|
|
${SearchRegistry}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${DownloadEnter}
|
|
|
|
|
${DownloadLeave}
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
; Variables
|
|
|
|
|
|
|
|
|
|
Var MinSYSPath
|
|
|
|
|
Var DownloadMinSYS
|
|
|
|
|
|
|
|
|
|
Var PythonPath
|
|
|
|
|
Var DownloadPython
|
|
|
|
|
|
|
|
|
|
Var DoNotRequireMiKTeX
|
|
|
|
|
Var MiKTeXPath
|
|
|
|
|
Var DownloadMiKTeX
|
|
|
|
|
|
|
|
|
|
Var DoNotRequireGhostscript
|
|
|
|
|
Var GhostscriptPath
|
|
|
|
|
Var DownloadGhostscript
|
|
|
|
|
|
2005-06-07 08:30:11 +00:00
|
|
|
|
Var DoNotRequireImageMagick
|
|
|
|
|
Var ImageMagickPath
|
|
|
|
|
Var DownloadImageMagick
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Var PDFViewerPath
|
|
|
|
|
|
|
|
|
|
Var PSViewerPath
|
|
|
|
|
Var PSViewerProg
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Var DoNotInstallLyX
|
|
|
|
|
Var PathPrefix
|
|
|
|
|
|
|
|
|
|
Var CreateFileAssociations
|
|
|
|
|
Var CreateDesktopIcon
|
|
|
|
|
Var StartmenuFolder
|
|
|
|
|
Var ProductRootKey
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Var LangName
|
|
|
|
|
Var LangCode
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
; Remember the installer language
|
|
|
|
|
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
|
|
|
|
|
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
|
|
|
|
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
|
|
|
|
|
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
!define MUI_ICON "${INSTALLER_ICON}"
|
|
|
|
|
!define MUI_UNICON "${INSTALLER_ICON}"
|
|
|
|
|
|
|
|
|
|
; Welcome page
|
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
|
|
|
|
|
|
Page custom DownloadMinSYS DownloadMinSYS_LeaveFunction
|
|
|
|
|
Page custom DownloadPython DownloadPython_LeaveFunction
|
|
|
|
|
Page custom DownloadMiKTeX DownloadMiKTeX_LeaveFunction
|
|
|
|
|
Page custom DownloadGhostscript DownloadGhostscript_LeaveFunction
|
2005-06-07 08:30:11 +00:00
|
|
|
|
Page custom DownloadImageMagick DownloadImageMagick_LeaveFunction
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Page custom SummariseDownloads SummariseDownloads_LeaveFunction
|
|
|
|
|
|
|
|
|
|
; Show the license.
|
|
|
|
|
!insertmacro MUI_PAGE_LICENSE "${PRODUCT_LICENSE_FILE}"
|
|
|
|
|
|
|
|
|
|
; Specify the installation directory.
|
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Specify LyX's menu language.
|
|
|
|
|
Page custom SelectMenuLanguage SelectMenuLanguage_LeaveFunction
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
; Define which components to install.
|
|
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
|
|
|
|
|
|
|
|
; Specify where to install program shortcuts.
|
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_ROOT_KEY}"
|
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
|
|
|
|
!insertmacro MUI_PAGE_STARTMENU ${PRODUCT_NAME} $StartmenuFolder
|
|
|
|
|
|
|
|
|
|
; Watch the components being installed.
|
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!define MUI_FINISHPAGE_RUN
|
2006-03-02 19:14:09 +00:00
|
|
|
|
!define MUI_FINISHPAGE_TEXT_LARGE
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)"
|
|
|
|
|
!define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProduct"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
|
|
|
|
|
; The uninstaller.
|
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
; Languages
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "English" # first language is the default language
|
2005-06-09 08:42:12 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "Danish"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "German"
|
2005-06-09 11:02:17 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "Spanish"
|
2005-06-09 08:42:12 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "French"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "Italian"
|
2005-06-09 11:45:30 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "Dutch"
|
2006-03-02 19:14:09 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "Polish"
|
2005-06-14 16:45:46 +00:00
|
|
|
|
!insertmacro MUI_LANGUAGE "Swedish"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
!include "lyx_languages\english.nsh"
|
2005-06-09 08:42:12 +00:00
|
|
|
|
!include "lyx_languages\danish.nsh"
|
2005-06-09 11:45:30 +00:00
|
|
|
|
!include "lyx_languages\dutch.nsh"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!include "lyx_languages\french.nsh"
|
|
|
|
|
!include "lyx_languages\german.nsh"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!include "lyx_languages\italian.nsh"
|
2006-03-02 19:14:09 +00:00
|
|
|
|
!include "lyx_languages\polish.nsh"
|
2005-06-09 11:02:17 +00:00
|
|
|
|
!include "lyx_languages\spanish.nsh"
|
2005-06-14 16:45:46 +00:00
|
|
|
|
!include "lyx_languages\swedish.nsh"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
LicenseData "$(LyXLicenseData)"
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
; Reserve Files
|
|
|
|
|
|
|
|
|
|
; These files should be inserted before other files in the data block
|
|
|
|
|
; Keep these lines before any File command
|
|
|
|
|
; Only for solid compression (by default, solid compression
|
|
|
|
|
; is enabled for BZIP2 and LZMA)
|
2005-07-15 10:05:13 +00:00
|
|
|
|
ReserveFile "io_download.ini"
|
|
|
|
|
ReserveFile "io_summary.ini"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
!insertmacro MUI_RESERVEFILE_LANGDLL
|
2005-07-15 10:05:13 +00:00
|
|
|
|
ReserveFile "io_ui_language.ini"
|
|
|
|
|
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
Section "!${PRODUCT_NAME}" SecCore
|
|
|
|
|
SectionIn RO
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
Section /o "$(SecAllUsersTitle)" SecAllUsers
|
|
|
|
|
SetShellVarContext all
|
|
|
|
|
StrCpy $ProductRootKey "HKLM"
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
Section "$(SecFileAssocTitle)" SecFileAssoc
|
|
|
|
|
StrCpy $CreateFileAssociations "true"
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
Section "$(SecDesktopTitle)" SecDesktop
|
|
|
|
|
StrCpy $CreateDesktopIcon "true"
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
; The '-' makes the section invisible.
|
|
|
|
|
; Sections are entered in order, so the settings above are all
|
|
|
|
|
; available to SecInstallation
|
|
|
|
|
Section "-Installation actions" SecInstallation
|
2005-07-15 10:05:13 +00:00
|
|
|
|
SetOverwrite on
|
2005-06-06 13:00:52 +00:00
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
|
File /r "${PRODUCT_SOURCEDIR}\Resources"
|
|
|
|
|
File /r "${PRODUCT_SOURCEDIR}\bin"
|
|
|
|
|
|
|
|
|
|
${if} "$PathPrefix" != ""
|
2006-03-02 19:14:09 +00:00
|
|
|
|
lyx_configure::set_path_prefix "$INSTDIR\Resources\configure" "$PathPrefix"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Pop $0
|
|
|
|
|
${if} $0 != 0
|
|
|
|
|
MessageBox MB_OK "$(ModifyingConfigureFailed)"
|
|
|
|
|
${endif}
|
2005-07-15 10:05:13 +00:00
|
|
|
|
${endif}
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
lyx_configure::create_lyx_bat "$INSTDIR\bin" "$LangCode"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Pop $0
|
|
|
|
|
${if} $0 != 0
|
|
|
|
|
MessageBox MB_OK "$(CreateCmdFilesFailed)"
|
|
|
|
|
${endif}
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
lyx_configure::run_configure "$INSTDIR\Resources\configure" "$PathPrefix"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Pop $0
|
|
|
|
|
${if} $0 != 0
|
|
|
|
|
MessageBox MB_OK "$(RunConfigureFailed)"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
|
|
|
|
|
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
|
|
|
|
|
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
|
|
|
|
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
|
|
|
|
|
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "${PRODUCT_EXE}"
|
|
|
|
|
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
|
|
|
|
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
|
|
|
|
|
|
|
|
|
|
CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
|
|
|
|
|
|
|
|
|
|
${if} $CreateDesktopIcon == "true"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
${if} $CreateFileAssociations == "true"
|
|
|
|
|
${CreateApplicationAssociation} \
|
|
|
|
|
"${PRODUCT_NAME}" \
|
|
|
|
|
"${PRODUCT_NAME}" \
|
|
|
|
|
"${PRODUCT_NAME} Document" \
|
|
|
|
|
"${PRODUCT_EXE},1" \
|
2005-07-15 10:05:13 +00:00
|
|
|
|
"${PRODUCT_BAT}"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
; Section descriptions
|
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
|
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecAllUsers} "$(SecAllUsersDescription)"
|
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
|
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
|
|
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-06-09 08:42:12 +00:00
|
|
|
|
!define MUI_LANGDLL_ALWAYSSHOW
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
; This hook function is called internally by NSIS on installer startup
|
|
|
|
|
Function .onInit
|
|
|
|
|
!insertmacro MUI_LANGDLL_DISPLAY
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_download.ini"
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_summary.ini"
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_ui_language.ini"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
; Default settings
|
|
|
|
|
; These can be reset to "all" in section SecAllUsers.
|
|
|
|
|
SetShellVarContext current
|
|
|
|
|
StrCpy $ProductRootKey "HKCU"
|
|
|
|
|
|
|
|
|
|
; This can be reset to "true" in section SecDesktop.
|
|
|
|
|
StrCpy $CreateDesktopIcon "false"
|
|
|
|
|
StrCpy $CreateFileAssociations "false"
|
|
|
|
|
|
|
|
|
|
; If the user does *not* have administrator privileges,
|
|
|
|
|
; then make section SecAllUsers readonly.
|
|
|
|
|
Call IsUserAdmin
|
|
|
|
|
Pop $0
|
|
|
|
|
${if} $0 == "true"
|
|
|
|
|
!define ENABLE 0x00000001
|
|
|
|
|
SectionGetFlags ${SecAllUsers} $0
|
|
|
|
|
IntOp $0 $0 | ${ENABLE}
|
|
|
|
|
SectionSetFlags ${SecAllUsers} $0
|
|
|
|
|
!undef ENABLE
|
|
|
|
|
${else}
|
|
|
|
|
!define READ_ONLY 0x00000010
|
|
|
|
|
SectionGetFlags ${SecAllUsers} $0
|
|
|
|
|
IntOp $0 $0 | ${READ_ONLY}
|
|
|
|
|
SectionSetFlags ${SecAllUsers} $0
|
|
|
|
|
!undef READ_ONLY
|
|
|
|
|
${endif}
|
|
|
|
|
|
2005-06-14 16:45:46 +00:00
|
|
|
|
Call SearchMinSYS
|
|
|
|
|
Call SearchPython
|
|
|
|
|
Call SearchMiKTeX
|
|
|
|
|
Call SearchGhostscript
|
|
|
|
|
Call SearchImageMagick
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Call SearchPDFViewer
|
|
|
|
|
Call SearchPSViewer
|
2005-06-14 16:45:46 +00:00
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
ClearErrors
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Function LaunchProduct
|
|
|
|
|
lyx_configure::set_env LANG $LangCode
|
|
|
|
|
Exec ${PRODUCT_EXE}
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
; Sets the value of the global $MinSYSPath variable.
|
2005-06-14 16:45:46 +00:00
|
|
|
|
Function SearchMinSYS
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; This function manipulates the registers $0-$3,
|
|
|
|
|
; so push their current content onto the stack.
|
|
|
|
|
Push $0
|
|
|
|
|
Push $1
|
|
|
|
|
Push $2
|
|
|
|
|
Push $3
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
; Search the registry for the MinSYS uninstaller.
|
|
|
|
|
; If successful, put its location in $2.
|
|
|
|
|
StrCpy $3 "Software\Microsoft\Windows\CurrentVersion\Uninstall"
|
|
|
|
|
StrCpy $2 ""
|
|
|
|
|
StrCpy $0 0
|
|
|
|
|
loop:
|
|
|
|
|
EnumRegKey $1 HKLM "$3" $0
|
|
|
|
|
${if} $1 == ""
|
|
|
|
|
Goto done
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
${StrLoc} $2 "$1" "MSYS-1.0" "<"
|
|
|
|
|
${if} $2 > 0
|
|
|
|
|
StrCpy $2 "$3\$1"
|
|
|
|
|
Goto done
|
|
|
|
|
${else}
|
|
|
|
|
StrCpy $2 ""
|
|
|
|
|
${endif}
|
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
|
Goto loop
|
|
|
|
|
done:
|
|
|
|
|
|
2005-06-14 16:45:46 +00:00
|
|
|
|
${SearchRegistry} \
|
|
|
|
|
$MinSYSPath \
|
|
|
|
|
"$2" \
|
|
|
|
|
"Inno Setup: App Path" \
|
|
|
|
|
"" \
|
|
|
|
|
"\bin"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
|
|
|
|
|
; Return the $0, $1, $2 and $2 registers to their original state
|
|
|
|
|
Pop $3
|
|
|
|
|
Pop $2
|
|
|
|
|
Pop $1
|
|
|
|
|
Pop $0
|
2005-06-14 16:45:46 +00:00
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function DownloadMinSYS
|
|
|
|
|
StrCpy $DownloadMinSYS "0"
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${DownloadEnter} \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
$MinSYSPath \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
0 \
|
|
|
|
|
"$(MinSYSDownloadLabel)" \
|
|
|
|
|
"$(MinSYSFolderLabel)" \
|
|
|
|
|
"$(MinSYSHeader)" \
|
|
|
|
|
"$(MinSYSDescription)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function DownloadMinSYS_LeaveFunction
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; This function manipulates the $0 register
|
|
|
|
|
; so push its current content onto the stack.
|
|
|
|
|
Push $0
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${DownloadLeave} \
|
|
|
|
|
$0 \
|
|
|
|
|
$DownloadMinSYS \
|
|
|
|
|
$MinSYSPath \
|
|
|
|
|
"http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82721&release_id=158803" \
|
|
|
|
|
"$(EnterMinSYSFolder)" \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
"sh.exe" \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
"$(InvalidMinSYSFolder)"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
|
|
|
|
|
; Return the $0 register to its original state
|
|
|
|
|
Pop $0
|
2005-06-06 13:00:52 +00:00
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Sets the value of the global $PythonPath variable.
|
2005-06-14 16:45:46 +00:00
|
|
|
|
Function SearchPython
|
|
|
|
|
${SearchRegistry} \
|
|
|
|
|
$PythonPath \
|
|
|
|
|
"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" \
|
|
|
|
|
"" \
|
|
|
|
|
"\Python.exe" \
|
|
|
|
|
""
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Function DownloadPython
|
2005-06-08 13:41:02 +00:00
|
|
|
|
StrCpy $DownloadPython "0"
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${DownloadEnter} \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
$PythonPath \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
0 \
|
|
|
|
|
"$(PythonDownloadLabel)" \
|
|
|
|
|
"$(PythonFolderLabel)" \
|
|
|
|
|
"$(PythonHeader)" \
|
|
|
|
|
"$(PythonDescription)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function DownloadPython_LeaveFunction
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; This function manipulates the $0 register
|
|
|
|
|
; so push its current content onto the stack.
|
|
|
|
|
Push $0
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${DownloadLeave} \
|
|
|
|
|
$0 \
|
|
|
|
|
$DownloadPython \
|
|
|
|
|
$PythonPath \
|
|
|
|
|
"http://www.python.org/download/" \
|
|
|
|
|
"$(EnterPythonFolder)" \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
"Python.exe" \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
"$(InvalidPythonFolder)"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
|
|
|
|
|
; Return the $0 register to its original state
|
|
|
|
|
Pop $0
|
2005-06-06 13:00:52 +00:00
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Sets the value of the global $MiKTeXPath variable.
|
2005-06-14 16:45:46 +00:00
|
|
|
|
Function SearchMiKTeX
|
|
|
|
|
${SearchRegistry} \
|
|
|
|
|
$MiKTeXPath \
|
|
|
|
|
"Software\MiK\MiKTeX\CurrentVersion\MiKTeX" \
|
|
|
|
|
"Install Root" \
|
|
|
|
|
"" \
|
|
|
|
|
"\miktex\bin"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Function DownloadMiKTeX
|
2005-06-08 13:41:02 +00:00
|
|
|
|
StrCpy $DoNotRequireMiKTeX "1"
|
|
|
|
|
StrCpy $DownloadMiKTeX "0"
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${DownloadEnter} \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
$MiKTeXPath \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
1 \
|
|
|
|
|
"$(MiKTeXDownloadLabel)" \
|
|
|
|
|
"$(MiKTeXFolderLabel)" \
|
|
|
|
|
"$(MiKTeXHeader)" \
|
|
|
|
|
"$(MiKTeXDescription)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function DownloadMiKTeX_LeaveFunction
|
|
|
|
|
${DownloadLeave} \
|
|
|
|
|
$DoNotRequireMiKTeX \
|
|
|
|
|
$DownloadMiKTeX \
|
|
|
|
|
$MiKTeXPath \
|
|
|
|
|
"http://www.miktex.org/setup.html" \
|
|
|
|
|
"$(EnterMiKTeXFolder)" \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
"latex.exe" \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
"$(InvalidMiKTeXFolder)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Sets the value of the global $GhostscriptPath variable.
|
2005-06-14 16:45:46 +00:00
|
|
|
|
Function SearchGhostscript
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; This function manipulates the $0 and $1 registers,
|
|
|
|
|
; so push their current content onto the stack.
|
|
|
|
|
Push $0
|
|
|
|
|
Push $1
|
|
|
|
|
|
2005-06-14 16:45:46 +00:00
|
|
|
|
; Find which version of ghostscript, if any, is installed.
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Store this value in $0.
|
|
|
|
|
StrCpy $0 ""
|
2005-06-14 16:45:46 +00:00
|
|
|
|
EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
|
|
|
|
|
${if} $1 != ""
|
|
|
|
|
StrCpy $0 "Software\AFPL Ghostscript\$1"
|
|
|
|
|
${else}
|
2005-07-15 10:05:13 +00:00
|
|
|
|
EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
|
|
|
|
|
${if} $1 != ""
|
|
|
|
|
StrCpy $0 "Software\GPL Ghostscript\$1"
|
|
|
|
|
${endif}
|
2005-06-14 16:45:46 +00:00
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
${SearchRegistry} \
|
|
|
|
|
$GhostscriptPath \
|
|
|
|
|
"$0" \
|
|
|
|
|
"GS_DLL" \
|
|
|
|
|
"\gsdll32.dll" \
|
|
|
|
|
""
|
2005-07-15 10:05:13 +00:00
|
|
|
|
|
|
|
|
|
; Return the $0 and $1 registers to their original states
|
|
|
|
|
Pop $1
|
|
|
|
|
Pop $0
|
2005-06-14 16:45:46 +00:00
|
|
|
|
FunctionEnd
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Function DownloadGhostscript
|
2005-06-08 13:41:02 +00:00
|
|
|
|
StrCpy $DoNotRequireGhostscript "1"
|
|
|
|
|
StrCpy $DownloadGhostscript "0"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
; Find which version of ghostscript, if any, is installed.
|
|
|
|
|
EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
|
2005-07-15 10:05:13 +00:00
|
|
|
|
${if} $1 == ""
|
|
|
|
|
EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
|
|
|
|
|
StrCpy $2 "True"
|
|
|
|
|
${endif}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${if} $1 != ""
|
2005-07-15 10:05:13 +00:00
|
|
|
|
${if} $2 == "True"
|
|
|
|
|
StrCpy $0 "Software\GPL Ghostscript\$1"
|
|
|
|
|
${else}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
StrCpy $0 "Software\AFPL Ghostscript\$1"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
${endif}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${else}
|
|
|
|
|
StrCpy $0 ""
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
${DownloadEnter} \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
$GhostscriptPath \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
1 \
|
|
|
|
|
"$(GhostscriptDownloadLabel)" \
|
|
|
|
|
"$(GhostscriptFolderLabel)" \
|
|
|
|
|
"$(GhostscriptHeader)" \
|
|
|
|
|
"$(GhostscriptDescription)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function DownloadGhostscript_LeaveFunction
|
|
|
|
|
${DownloadLeave} \
|
|
|
|
|
$DoNotRequireGhostscript \
|
|
|
|
|
$DownloadGhostscript \
|
|
|
|
|
$GhostscriptPath \
|
|
|
|
|
"http://www.cs.wisc.edu/~ghost/doc/AFPL/index.htm" \
|
|
|
|
|
"$(EnterGhostscriptFolder)" \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
"gswin32c.exe" \
|
2005-06-06 13:00:52 +00:00
|
|
|
|
"$(InvalidGhostscriptFolder)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
; Sets the value of the global $ImageMagickPath variable.
|
2005-06-14 16:45:46 +00:00
|
|
|
|
Function SearchImageMagick
|
|
|
|
|
${SearchRegistry} \
|
|
|
|
|
$ImageMagickPath \
|
|
|
|
|
"Software\ImageMagick\Current" \
|
|
|
|
|
"BinPath" \
|
|
|
|
|
"" \
|
|
|
|
|
""
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
2005-06-07 08:30:11 +00:00
|
|
|
|
Function DownloadImageMagick
|
2005-06-08 13:41:02 +00:00
|
|
|
|
StrCpy $DoNotRequireImageMagick "1"
|
|
|
|
|
StrCpy $DownloadImageMagick "0"
|
|
|
|
|
|
2005-06-07 08:30:11 +00:00
|
|
|
|
${DownloadEnter} \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
$ImageMagickPath \
|
2005-06-07 08:30:11 +00:00
|
|
|
|
1 \
|
|
|
|
|
"$(ImageMagickDownloadLabel)" \
|
|
|
|
|
"$(ImageMagickFolderLabel)" \
|
|
|
|
|
"$(ImageMagickHeader)" \
|
|
|
|
|
"$(ImageMagickDescription)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function DownloadImageMagick_LeaveFunction
|
|
|
|
|
${DownloadLeave} \
|
|
|
|
|
$DoNotRequireImageMagick \
|
|
|
|
|
$DownloadImageMagick \
|
|
|
|
|
$ImageMagickPath \
|
|
|
|
|
"http://www.imagemagick.org/script/binary-releases.php" \
|
|
|
|
|
"$(EnterImageMagickFolder)" \
|
2005-06-14 16:45:46 +00:00
|
|
|
|
"convert.exe" \
|
2005-06-07 08:30:11 +00:00
|
|
|
|
"$(InvalidImageMagickFolder)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
; Sets the value of the global $PDFViewerPath variable.
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Function SearchPDFViewer
|
2006-03-02 19:14:09 +00:00
|
|
|
|
; test if a pdf-viewer is installed, only test for Acrobat, Adobe Reader (AroRD32), and GSview32
|
2005-07-15 10:05:13 +00:00
|
|
|
|
StrCpy $PDFViewerPath ""
|
2006-03-02 19:14:09 +00:00
|
|
|
|
ReadRegStr $PDFViewerPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe" "Path"
|
|
|
|
|
${if} $PDFViewerPath == ""
|
|
|
|
|
ReadRegStr $PDFViewerPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe" "Path"
|
|
|
|
|
${endif}
|
|
|
|
|
${if} $PDFViewerPath == ""
|
|
|
|
|
ReadRegStr $PDFViewerPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
|
|
|
|
|
${endif}
|
|
|
|
|
StrCpy $0 $PDFViewerPath "" -1 ;remove the "\" at the end
|
|
|
|
|
${if} $0 == "\"
|
|
|
|
|
StrCpy $PDFViewerPath $PDFViewerPath -1
|
|
|
|
|
${endif}
|
2005-07-15 10:05:13 +00:00
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
Function SearchPSViewer
|
2006-03-02 19:14:09 +00:00
|
|
|
|
; This function manipulates the $0 register,
|
|
|
|
|
; so push its current content onto the stack.
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Push $0
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
; test if a ps-viewer is installed, only check for GSview32
|
2005-07-15 10:05:13 +00:00
|
|
|
|
StrCpy $PSViewerPath ""
|
2006-03-02 19:14:09 +00:00
|
|
|
|
ReadRegStr $PSViewerPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
|
|
|
|
|
; Failed to find anything that way. Try another.
|
|
|
|
|
${if} $PSViewerPath == ""
|
|
|
|
|
ReadRegStr $PSViewerProg HKCR "psfile\shell\open\command" ""
|
|
|
|
|
; Extract the first quoted word.
|
|
|
|
|
${StrTok} $0 "$PSViewerProg" '"' '1' '0'
|
|
|
|
|
${if} $0 != ""
|
|
|
|
|
StrCpy $PSViewerProg $0
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
${StrTrim} $PSViewerProg "$PSViewerProg"
|
|
|
|
|
; Split into <path,exe> pair
|
|
|
|
|
${StrStrAdv} $PSViewerPath $PSViewerProg "\" "<" "<" "0" "0" "0"
|
|
|
|
|
${StrStrAdv} $PSViewerProg $PSViewerProg "\" "<" ">" "0" "0" "0"
|
|
|
|
|
${endif}
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
; Return the $0 register to its original states
|
2005-07-15 10:05:13 +00:00
|
|
|
|
Pop $0
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
Function SummariseDownloads
|
|
|
|
|
|
|
|
|
|
StrCpy $PathPrefix ""
|
|
|
|
|
${if} $MinSYSPath != ""
|
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$MinSYSPath"
|
|
|
|
|
${endif}
|
|
|
|
|
${if} $PythonPath != ""
|
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$PythonPath"
|
|
|
|
|
${endif}
|
|
|
|
|
${if} $MiKTeXPath != ""
|
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$MiKTeXPath"
|
|
|
|
|
${endif}
|
|
|
|
|
${if} $GhostscriptPath != ""
|
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
|
|
|
|
|
${endif}
|
2005-06-07 08:30:11 +00:00
|
|
|
|
${if} $ImageMagickPath != ""
|
|
|
|
|
StrCpy $PathPrefix "$PathPrefix;$ImageMagickPath"
|
|
|
|
|
${endif}
|
2005-06-06 13:00:52 +00:00
|
|
|
|
; Remove the leading ';'
|
|
|
|
|
StrCpy $PathPrefix "$PathPrefix" "" 1
|
|
|
|
|
|
|
|
|
|
IntOp $DoNotInstallLyX $DownloadMinSYS + $DownloadPython
|
|
|
|
|
IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadMiKTeX
|
|
|
|
|
IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadGhostscript
|
2005-06-07 08:30:11 +00:00
|
|
|
|
IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadImageMagick
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
${if} "$DoNotInstallLyX" == 1
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_summary.ini" "Field 1" "Text" "$(SummaryPleaseInstall)"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${else}
|
2005-06-14 16:45:46 +00:00
|
|
|
|
${StrNSISToIO} $0 '$PathPrefix'
|
2005-07-15 10:05:13 +00:00
|
|
|
|
${StrRep} $0 "$0" ";" "\r\n"
|
2005-06-14 16:45:46 +00:00
|
|
|
|
StrCpy $0 "$(SummaryPathPrefix)\r\n\r\n$0"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_summary.ini" "Field 1" "Text" "$0"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(SummaryTitle)" ""
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_summary.ini"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
Function SummariseDownloads_LeaveFunction
|
|
|
|
|
${if} "$DoNotInstallLyX" == 1
|
|
|
|
|
Quit
|
|
|
|
|
${endif}
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
Function SelectMenuLanguage
|
|
|
|
|
StrCpy $LangName ""
|
|
|
|
|
|
|
|
|
|
;tranlate NSIS's language code to the language name; macro from lyx_utils.nsh
|
|
|
|
|
!insertmacro TranslateLangCode $LangName $Language
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_ui_language.ini" "Field 1" "State" "$(UILanguageAvailableLanguages)"
|
2005-07-15 10:05:13 +00:00
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_ui_language.ini" "Field 2" "State" "$LangName"
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(UILangageTitle)" "$(UILangageDescription)"
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_ui_language.ini"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
|
|
|
|
|
|
Function SelectMenuLanguage_LeaveFunction
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_READ $LangName "io_ui_language.ini" "Field 2" "State"
|
|
|
|
|
|
|
|
|
|
;Get the language code; macro from lyx_utils.nsh
|
|
|
|
|
StrCpy $LangCode ""
|
|
|
|
|
!insertmacro GetLangCode $LangCode $LangName
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
2005-06-06 13:00:52 +00:00
|
|
|
|
;--------------------------------
|
|
|
|
|
; The Uninstaller
|
|
|
|
|
|
|
|
|
|
Function un.onInit
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_UNGETLANGUAGE
|
|
|
|
|
|
|
|
|
|
; Ascertain whether the user has sufficient privileges to uninstall.
|
|
|
|
|
SetShellVarContext current
|
|
|
|
|
|
|
|
|
|
ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
|
|
|
|
|
${if} $0 == ""
|
|
|
|
|
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
|
|
|
|
|
${if} $0 == ""
|
|
|
|
|
MessageBox MB_OK "$(UnNotInRegistryLabel)"
|
|
|
|
|
${endif}
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
${if} $0 == "HKLM"
|
|
|
|
|
Call un.IsUserAdmin
|
|
|
|
|
Pop $0
|
|
|
|
|
${if} $0 == "true"
|
|
|
|
|
SetShellVarContext all
|
|
|
|
|
${else}
|
|
|
|
|
MessageBox MB_OK "$(UnNotAdminLabel)"
|
|
|
|
|
Abort
|
|
|
|
|
${endif}
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
|
|
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2
|
|
|
|
|
Abort
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Function un.onUninstSuccess
|
|
|
|
|
HideWindow
|
|
|
|
|
MessageBox MB_ICONINFORMATION|MB_OK "$(UnRemoveSuccessLabel)"
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Section Uninstall
|
|
|
|
|
RMDir /r $INSTDIR
|
|
|
|
|
|
|
|
|
|
ReadRegStr $0 ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu"
|
|
|
|
|
RMDir /r "$0"
|
|
|
|
|
|
|
|
|
|
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
|
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
DeleteRegKey "HKCU" "${PRODUCT_UNINST_KEY}"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
DeleteRegKey ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
|
|
|
|
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
|
2006-03-02 19:14:09 +00:00
|
|
|
|
DeleteRegKey HKCR "Applications\lyx.exe"
|
|
|
|
|
DeleteRegKey HKCR "Applications\lyx.bat"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
2006-03-02 19:14:09 +00:00
|
|
|
|
; remove extension .lyx
|
2005-06-06 13:00:52 +00:00
|
|
|
|
${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
|
2006-03-02 19:14:09 +00:00
|
|
|
|
DeleteRegKey HKCR "${PRODUCT_NAME}"
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
SetAutoClose true
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
; eof
|