-; Aspell dictionaries
+# Aspell dictionaries
Function DownloadDictionary
StrCpy $String $String -2 ; delete the linebreak characters at the end
- ; Download aspell dictionaries,
- ; if first download repository is not available try the other ones listed in "AspellRepositories.txt"
+ # Download aspell dictionaries,
+ # if first download repository is not available try the other ones listed in "AspellRepositories.txt"
FileOpen $R5 "$INSTDIR\Resources\AspellRepositories.txt" r
${For} $4 1 4
FileRead $R5 $Search ; $Search is now the AspellLocation
Push $R0
InetLoad::load /TIMEOUT=5000 "$Search/aspell6-$String.exe" "$INSTDIR\aspell6-$String.exe" /END
Pop $R0
- ; test if the downloaded file is really the expected one, because if the file didn't exist on the download server,
- ; berlios.de downloads a text file with the name of the non-existing file that contains the line "File doesn't exist"
+ # test if the downloaded file is really the expected one, because if the file didn't exist on the download server,
+ # berlios.de downloads a text file with the name of the non-existing file that contains the line "File doesn't exist"
FileOpen $R4 "$INSTDIR\aspell6-$String.exe" r
FileRead $R4 $Search
FileClose $R4
${Next}
FileClose $R5
- ; Download failed
+ # Download failed
${if} $R0 != "OK"
MessageBox MB_OK|MB_ICONEXCLAMATION "$(AspellDownloadFailed) $R0"
StrCpy $AspellInstallYes "$RunNumber$AspellInstallYes"
Goto abortinstall
${endif}
- ; Download successful
+ # Download successful
ExecWait '"$INSTDIR\aspell6-$String.exe" /NoDirChange /AutoClose'
${if} $AspellBaseReg == "HKLM"
ReadRegStr $R2 HKLM "Software\Aspell\Dictionaries" $DictCode
FunctionEnd
-;--------------------------------
+#--------------------------------
Function InstallAspellDictionary
StrCpy $AspellInstallYes ""
- ; install the english dictionary if not already installed
+ # install the english dictionary if not already installed
StrCpy $DictCode "en"
StrCpy $RunNumber "1"
${if} $AspellBaseReg == "HKLM" ; $AspellBaseReg is either "HKLM" or if Aspell is already installed only for the current user "HKCU"
StrCpy $AspellInstallYes "$RunNumber$AspellInstallYes"
${endif}
- ; install the dictionary corresponding to the system and the chosen menu language
- ; check if the system language and the chosen menu language are the same, if not install
- ; both dictionaries
+ # install the dictionary corresponding to the system and the chosen menu language
+ # check if the system language and the chosen menu language are the same, if not install
+ # both dictionaries
StrCpy $DictCode $LangCode 2
StrCpy $0 $DictCode ; $0 is now the language code of the chosen LyX menu language
StrCpy $RunNumber "2"
StrCpy $AspellInstallYes "4$AspellInstallYes"
${endif}
- ; check the registry to divide between nothing installed or all already installed
+ # check the registry to divide between nothing installed or all already installed
${if} $AspellInstallYes == "321"
${orif} $AspellInstallYes == "421"
${if} $AspellBaseReg == "HKLM"
Delete "$INSTDIR\Resources\AspellDictionaryNames.txt"
Delete "$INSTDIR\Resources\AspellRepositories.txt"
- ; show message about Aspell dictionaries
- ; the code rule to display the correct message:
- ; - when the englisch dictionary is already installed or couldn't be installed -> set a "1"
- ; - when the dictionary of the chosen LyX menu language is already installed or couldn't be installed -> set a "2"
- ; - when the dictionary of the Windows system language is already installed or couldn't be installed -> set a "3"
- ; - when the dictionary of the chosen LyX menu language is equal to the dictionary of the Windows system language -> set a "4"
+ # show message about Aspell dictionaries
+ # the code rule to display the correct message:
+ # - when the englisch dictionary is already installed or couldn't be installed -> set a "1"
+ # - when the dictionary of the chosen LyX menu language is already installed or couldn't be installed -> set a "2"
+ # - when the dictionary of the Windows system language is already installed or couldn't be installed -> set a "3"
+ # - when the dictionary of the chosen LyX menu language is equal to the dictionary of the Windows system language -> set a "4"
${if} $AspellInstallYes == "32"
${orif} $AspellInstallYes == "42"
MessageBox MB_ICONINFORMATION|MB_DEFBUTTON2|MB_YESNO "$(AspellPartStart)$(AspellPart1)$(AspellPart4)" IDYES DownloadNow IDNO DownloadLater
FunctionEnd
-;---------------------------
+#---------------------------
Function un.UninstAspell
ReadRegStr $1 HKLM "Software\Aspell" "Base Path"
- ; delete Aspells' install folder
+ # delete Aspells' install folder
RMDir /r $1
- ; unregister Aspell and its dictionaries
+ # unregister Aspell and its dictionaries
DeleteRegKey HKLM "Software\Aspell"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell6-Dictionary-af"
-; The '-' makes the section invisible.
-; Sections are entered in order, so the settings above are all
-; available to SecInstallation
+# The '-' makes the section invisible.
+# Sections are entered in order, so the settings above are all
+# available to SecInstallation
Section "-Installation actions" SecInstallation
- ; extract all files
+ # extract all files
SetOutPath "$INSTDIR"
File /r "${PRODUCT_SOURCEDIR}\bin"
File /r "${PRODUCT_SOURCEDIR}\etc"
File /r "${PRODUCT_SOURCEDIR}\Resources"
File /r "${PRODUCT_SOURCEDIR}\external"
- ; install MiKTeX if not already installed
+ # install MiKTeX if not already installed
${if} $LatexPath == ""
- ; launch MiKTeX's installer
+ # launch MiKTeX's installer
MessageBox MB_OK|MB_ICONINFORMATION "$(LatexInfo)"
ExecWait ${MiKTeXInstall}
- ; test if MiKTeX is installed
+ # test if MiKTeX is installed
ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
StrCpy $Search "miktex"
Call LaTeXCheck
Call LaTeXCheck
${endif}
${if} $LatexPath != ""
- ; set package repository (MiKTeX's primary package repository)
+ # set package repository (MiKTeX's primary package repository)
WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
StrCpy $MiKTeXInstalled "yes"
${if} $MiKTeXUser != "HKCU"
StrCpy $MiKTeXPath "$LatexPath" -11
- ;MessageBox MB_OK|MB_ICONINFORMATION "$(MiKTeXPathInfo)" ; info that MiKTeX's installation folder must have write permissions for all users to work properly
+ #MessageBox MB_OK|MB_ICONINFORMATION "$(MiKTeXPathInfo)" ; info that MiKTeX's installation folder must have write permissions for all users to work properly
${endif}
${else}
MessageBox MB_OK|MB_ICONSTOP "$(LatexError1)"
${endif}
${if} $GhostscriptPath == ""
- ; register Ghostscript
+ # register Ghostscript
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_DLL" "${GhostscriptDir}\bin\gsdll32.dll"
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_LIB" "${GhostscriptDir}\lib;${GhostscriptDir}\fonts;${GhostscriptDir}\Resource"
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
StrCpy $GhostscriptPath "${GhostscriptDir}\bin"
${else}
- ; delete unnecessary files
+ # delete unnecessary files
RMDir /r ${GhostscriptDir}
${endif}
${if} $ImageMagickPath == ""
- ; register ImageMagick
+ # register ImageMagick
WriteRegStr HKLM "SOFTWARE\Classes\Applications" "AutoRun" "${ImageMagickDir}\convert.exe $$"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath" "${ImageMagickDir}"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath" "${ImageMagickDir}\modules\coders"
WriteRegStr HKLM "Software\ImageMagick" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
StrCpy $ImageMagickPath ${ImageMagickDir}
${else}
- ; delete unnecessary files
+ # delete unnecessary files
RMDir /r ${ImageMagickDir}
${endif}
${if} $AspellPath == ""
- ; extract Aspell's program files
+ # extract Aspell's program files
SetOutPath "$INSTDIR\external"
File /r "${PRODUCT_SOURCEDIR}\${AspellInstall}"
- ; copy the files and register Aspell
+ # copy the files and register Aspell
CopyFiles "$INSTDIR\${AspellInstall}" "$APPDATA"
WriteRegStr HKLM "SOFTWARE\Aspell" "Base Path" "${AspellDir}"
${endif}
${if} $AiksaurusPath == ""
- ; extract Aiksaurus' program files
+ # extract Aiksaurus' program files
SetOutPath "$INSTDIR\external"
File /r "${PRODUCT_SOURCEDIR}\${AiksaurusInstall}"
- ; copy the files and register Aiksaurus
+ # copy the files and register Aiksaurus
CopyFiles "$INSTDIR\${AiksaurusInstall}" "$APPDATA"
-; WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
-; WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
+# WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
+# WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
${endif}
${if} $PSVPath == ""
${if} $InstallGSview == "true"
- ; launch installer
+ # launch installer
MessageBox MB_OK|MB_ICONINFORMATION "$(GSviewInfo)"
ExecWait "$INSTDIR\${GSviewInstall}"
- ; test if GSview is installed
+ # test if GSview is installed
StrCpy $PSVPath ""
ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
${if} $PSVPath == ""
${if} $BibTeXEditorPath == ""
${if} $InstallJabRef == "true"
- ; launch installer
+ # launch installer
MessageBox MB_OK|MB_ICONINFORMATION "$(JabRefInfo)"
ExecWait "$INSTDIR\${JabRefInstall}"
- ; test if JabRef is installed
+ # test if JabRef is installed
StrCpy $BibTeXEditorPath ""
ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "UninstallString"
${if} $BibTeXEditorPath == ""
${endif}
${endif}
- ; create the PathPrefix
+ # create the PathPrefix
StrCpy $PathPrefix "$INSTDIR\bin"
${if} $PythonPath != ""
StrCpy $PathPrefix "$PathPrefix;$PythonPath"
StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath"
${endif}
- ; install the LaTeX class files that are delivered with LyX
- ; and enable MiKTeX's automatic package installation
+ # install the LaTeX class files that are delivered with LyX
+ # and enable MiKTeX's automatic package installation
StrCpy $String $LatexPath
StrCpy $Search "miktex\bin"
StrLen $3 $String
${if} $Pointer != "-1" ; if something was found
IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\miktex\bin"
StrCpy $String $String "$Pointer" ; $String is now the part before "\miktex\bin"
- ; install LaTeX class files
+ # install LaTeX class files
SetOutPath "$String\tex\latex"
File "${ClassFileDir}\cv.cls"
CreateDirectory "$String\tex\latex\lyx"
CreateDirectory "$String\tex\latex\broadway"
SetOutPath "$String\tex\latex\broadway"
File "${ClassFileDir}\broadway.cls"
- ; install LaTeX-package dvipost (dvipost is not available for MiKTeX)
+ # install LaTeX-package dvipost (dvipost is not available for MiKTeX)
SetOutPath "$String\tex\latex\"
File /r "${DVIPostFileDir}"
${if} $MiKTeXVersion == "2.4"
- ; refresh MiKTeX's file name database
+ # refresh MiKTeX's file name database
ExecWait "$String\miktex\bin\initexmf --update-fndb"
- ; delete MiKTeX 2.4's dvipng executable as it is an old broken version. Then install a working one.
+ # delete MiKTeX 2.4's dvipng executable as it is an old broken version. Then install a working one.
Delete "$String\miktex\bin\dvipng.exe"
- ; Install a new one
+ # Install a new one
SetOutPath "$String\miktex\bin"
File "${PRODUCT_DIR}\LyX\external\dvipng.exe"
- ; enable package installation without asking (1=Yes, 0=No, 2=Always Ask Before Installing)
+ # enable package installation without asking (1=Yes, 0=No, 2=Always Ask Before Installing)
WriteRegStr HKCU "SOFTWARE\MiK\MiKTeX\CurrentVersion\MiKTeX" "InstallPackagesOnTheFly" "1"
WriteRegStr HKCU "SOFTWARE\MiK\MiKTeX\CurrentVersion\MPM\Settings" "" ""
- ; Setting package repository (MiKTeX's primary package repository)
+ # Setting package repository (MiKTeX's primary package repository)
WriteRegStr HKCU "SOFTWARE\MiK\MiKTeX\CurrentVersion\MPM" "RemotePackageRepository" "${MiKTeXRepo}"
${else} ; if MiKTeX 2.5
- ; refresh MiKTeX's file name database
+ # refresh MiKTeX's file name database
ExecWait "$LaTeXPath\initexmf --update-fndb"
- ; enable package installation without asking (t = Yes, f = No)
+ # enable package installation without asking (t = Yes, f = No)
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\2.5\MPM" "AutoInstall" "1" ; if only for curent user
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_AUTOINSTALL" "t"
- ; set package repository (MiKTeX's primary package repository)
+ # set package repository (MiKTeX's primary package repository)
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\2.5\MPM" "RemoteRepository" "${MiKTeXRepo}" ; if only for curent user
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\2.5\MPM" "RepositoryType" "remote" ; if only for curent user
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_REPOSITORY" "${MiKTeXRepo}"
${endif}
- ; enable MiKTeX's automatic package installation
+ # enable MiKTeX's automatic package installation
ExecWait '$LaTeXPath\mpm.com --update-fndb'
-; the following feature is planned to be used for a possible CD-version
-; ; copy LaTeX-packages needed by LyX
-; SetOutPath "$INSTDIR"
-; File /r "${LaTeXPackagesDir}"
+# the following feature is planned to be used for a possible CD-version
+# ; copy LaTeX-packages needed by LyX
+# SetOutPath "$INSTDIR"
+# File /r "${LaTeXPackagesDir}"
${endif} ; end ${if} $Pointer
- ; install Aspell dictionaries
+ # install Aspell dictionaries
${if} $LangCode == "nb_NO"
StrCpy $LangCode "no_NO" ; we only have a norwegian dictionary available
${endif}
Call InstallAspellDictionary ; function from aspell.nsh
- ; configure LyX
- ; Set a path prefix in lyxrc.dist
+ # configure LyX
+ # Set a path prefix in lyxrc.dist
ClearErrors
${if} "$PathPrefix" != ""
Delete "$INSTDIR\Resources\lyxrc.dist"
MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)"
${endif}
- ; Create a batch file to start LyX with the environment variables set
+ # Create a batch file to start LyX with the environment variables set
ClearErrors
Delete "${PRODUCT_BAT}"
FileOpen $R1 "${PRODUCT_BAT}" w
IfErrors 0 +2
MessageBox MB_OK|MB_ICONEXCLAMATION "$(CreateCmdFilesFailed)"
- ; set the preferences file
- ; having one preferences file that is modified to fit the needs isn't possible because the command
- ; ${LineFind} "$INSTDIR\Resources\preferences" "" "-16:-11" "DeleteLines" ; macro from TextFunc.nsh
- ; removes the file permissions for Users, so that it can later not be read (bug in ${LineFind} of TextFunc.nsh)
- ; if not Acrobat or Adobe Reader is used
+ # set the preferences file
+ # having one preferences file that is modified to fit the needs isn't possible because the command
+ # ${LineFind} "$INSTDIR\Resources\preferences" "" "-16:-11" "DeleteLines" ; macro from TextFunc.nsh
+ # removes the file permissions for Users, so that it can later not be read (bug in ${LineFind} of TextFunc.nsh)
+ # if not Acrobat or Adobe Reader is used
${if} $Acrobat == "None" ; clear the entries in the preferences file that define PDFViewWin7 or 8 as viewer
Rename "$INSTDIR\Resources\preferencesGSview" "$INSTDIR\Resources\preferences"
Delete "$INSTDIR\Resources\preferences7"
Delete "$INSTDIR\Resources\preferences8"
${endif}
- ; if Acrobat or Adobe Reader is used
+ # if Acrobat or Adobe Reader is used
${if} $Acrobat == "7" ; clear the entries in the preferences file that define PDFViewWin8 as viewer
Rename "$INSTDIR\Resources\preferences7" "$INSTDIR\Resources\preferences"
Delete "$INSTDIR\Resources\preferences8"
Delete "$INSTDIR\Resources\preferencesGSview"
${endif}
- ; register LyX
+ # register LyX
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
${endif}
- ; register the extension .lyx
+ # register the extension .lyx
${if} $CreateFileAssociations == "true"
${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
${endif}
- ; create the LyX Application Data folder for all users
- ; this folder is automatically created by LyX when it is first started but we want to start LyX with a specific session file,
- ; so we create this folder before LyX starts and copy there the session file
+ # create the LyX Application Data folder for all users
+ # this folder is automatically created by LyX when it is first started but we want to start LyX with a specific session file,
+ # so we create this folder before LyX starts and copy there the session file
Call CreateAppPathSub ; function from LyXUtils.nsh
- ; delete unnecessary files
+ # delete unnecessary files
${if} $DelPythonFiles == "True"
Delete $INSTDIR\bin\python.exe
Delete $INSTDIR\bin\python25.dll
${endif}
RMDir /r $INSTDIR\external
- ; create Uninstaller
+ # create Uninstaller
WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
- ; run LyX's configure script
- ; create a bat-file to start configure in a console window so that the user see the progress
- ; of the configuration and to have a signal when the configuration is ready to start LyX
- ; this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
- ; time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
- ; a batch file is needed because simply calling ExecWait '"$INSTDIR\bin\python.exe" "$INSTDIR\Resources\configure.py"'
- ; creates the config files in $INSTDIR\bin
+ # run LyX's configure script
+ # create a bat-file to start configure in a console window so that the user see the progress
+ # of the configuration and to have a signal when the configuration is ready to start LyX
+ # this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
+ # time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
+ # a batch file is needed because simply calling ExecWait '"$INSTDIR\bin\python.exe" "$INSTDIR\Resources\configure.py"'
+ # creates the config files in $INSTDIR\bin
StrCpy $1 $INSTDIR 2 ; get drive letter
FileOpen $R1 "$INSTDIR\Resources\configLyX.bat" w
FileWrite $R1 'cd $INSTDIR\Resources\$\r$\n\
ExecWait '"$INSTDIR\Resources\configLyX.bat"'
Delete "$INSTDIR\Resources\configLyX.bat"
- ; ask to update MiKTeX
+ # ask to update MiKTeX
${if} $MiKTeXInstalled == "yes"
MessageBox MB_YESNO|MB_ICONINFORMATION "$(MiKTeXInfo)" IDYES UpdateNow IDNO UpdateLater
UpdateNow:
UpdateLater:
${endif}
- ; save MiKTeX's install path to be able to remove LyX's LaTeX-files in the uninstaller
+ # save MiKTeX's install path to be able to remove LyX's LaTeX-files in the uninstaller
FileOpen $R1 "$INSTDIR\Resources\uninstallPaths.dat" w
FileWrite $R1 '$LaTeXPath'
FileClose $R1
-; The '-' makes the section invisible.
-; Sections are entered in order, so the settings above are all
-; available to SecInstallation
+# The '-' makes the section invisible.
+# Sections are entered in order, so the settings above are all
+# available to SecInstallation
Section "-Installation actions" SecInstallation
- ; extract all files
+ # extract all files
SetOutPath "$INSTDIR"
File /r "${PRODUCT_SOURCEDIR}\bin"
File /r "${PRODUCT_SOURCEDIR}\etc"
File /r "${PRODUCT_SOURCEDIR}\Resources"
${if} $GhostscriptPath == ""
- ; register Ghostscript
+ # register Ghostscript
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_DLL" "${GhostscriptDir}\bin\gsdll32.dll"
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_LIB" "${GhostscriptDir}\lib;${GhostscriptDir}\fonts;${GhostscriptDir}\Resource"
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
StrCpy $GhostscriptPath "${GhostscriptDir}\bin"
${else}
- ; delete unnecessary files
+ # delete unnecessary files
RMDir /r ${GhostscriptDir}
${endif}
${if} $ImageMagickPath == ""
- ; register ImageMagick
+ # register ImageMagick
WriteRegStr HKLM "SOFTWARE\Classes\Applications" "AutoRun" "${ImageMagickDir}\convert.exe $$"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath" "${ImageMagickDir}"
WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath" "${ImageMagickDir}\modules\coders"
WriteRegStr HKLM "Software\ImageMagick" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
StrCpy $ImageMagickPath ${ImageMagickDir}
${else}
- ; delete unnecessary files
+ # delete unnecessary files
RMDir /r ${ImageMagickDir}
${endif}
${if} $AspellPath == ""
- ; extract Aspell's program files
+ # extract Aspell's program files
SetOutPath "$INSTDIR\external"
File /r "${PRODUCT_SOURCEDIR}\${AspellInstall}"
- ; copy the files and register Aspell
+ # copy the files and register Aspell
CopyFiles "$INSTDIR\${AspellInstall}" "$APPDATA"
WriteRegStr HKLM "SOFTWARE\Aspell" "Base Path" "${AspellDir}"
${endif}
${if} $AiksaurusPath == ""
- ; extract Aiksaurus' program files
+ # extract Aiksaurus' program files
SetOutPath "$INSTDIR\external"
File /r "${PRODUCT_SOURCEDIR}\${AiksaurusInstall}"
- ; copy the files and register Aiksaurus
+ # copy the files and register Aiksaurus
CopyFiles "$INSTDIR\${AiksaurusInstall}" "$APPDATA"
-; WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
-; WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
+# WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes" ; special entry to tell the uninstaller that it was installed with LyX
+# WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
${endif}
- ; create the PathPrefix
+ # create the PathPrefix
StrCpy $PathPrefix "$INSTDIR\bin"
${if} $PythonPath != ""
StrCpy $PathPrefix "$PathPrefix;$PythonPath"
StrCpy $PathPrefix "$PathPrefix;$ImageEditorPath"
${endif}
- ; install the LaTeX class files that are delivered with LyX
- ; and enable MiKTeX's automatic package installation
+ # install the LaTeX class files that are delivered with LyX
+ # and enable MiKTeX's automatic package installation
StrCpy $String $LatexPath
StrCpy $Search "miktex\bin"
StrLen $3 $String
${if} $Pointer != "-1" ; if something was found
IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\miktex\bin"
StrCpy $String $String "$Pointer" ; $String is now the part before "\miktex\bin"
- ; install LaTeX class files
+ # install LaTeX class files
SetOutPath "$String\tex\latex"
File "${ClassFileDir}\cv.cls"
CreateDirectory "$String\tex\latex\lyx"
CreateDirectory "$String\tex\latex\broadway"
SetOutPath "$String\tex\latex\broadway"
File "${ClassFileDir}\broadway.cls"
- ; install LaTeX-package dvipost (dvipost is not available for MiKTeX)
+ # install LaTeX-package dvipost (dvipost is not available for MiKTeX)
SetOutPath "$String\tex\latex\"
File /r "${DVIPostFileDir}"
${if} $MiKTeXVersion == "2.4"
- ; refresh MiKTeX's file name database
+ # refresh MiKTeX's file name database
ExecWait "$String\miktex\bin\initexmf --update-fndb"
- ; delete MiKTeX 2.4's dvipng executable as it is an old broken version. Then install a working one.
+ # delete MiKTeX 2.4's dvipng executable as it is an old broken version. Then install a working one.
Delete "$String\miktex\bin\dvipng.exe"
- ; Install a new one
+ # Install a new one
SetOutPath "$String\miktex\bin"
File "${PRODUCT_DIR}\LyX\external\dvipng.exe"
- ; enable package installation without asking (1=Yes, 0=No, 2=Always Ask Before Installing)
+ # enable package installation without asking (1=Yes, 0=No, 2=Always Ask Before Installing)
WriteRegStr HKCU "SOFTWARE\MiK\MiKTeX\CurrentVersion\MiKTeX" "InstallPackagesOnTheFly" "1"
WriteRegStr HKCU "SOFTWARE\MiK\MiKTeX\CurrentVersion\MPM\Settings" "" ""
- ; Setting package repository (MiKTeX's primary package repository)
+ # Setting package repository (MiKTeX's primary package repository)
WriteRegStr HKCU "SOFTWARE\MiK\MiKTeX\CurrentVersion\MPM" "RemotePackageRepository" "${MiKTeXRepo}"
${else} ; if MiKTeX 2.5
- ; refresh MiKTeX's file name database
+ # refresh MiKTeX's file name database
ExecWait "$LaTeXPath\initexmf --update-fndb"
- ; enable package installation without asking (t = Yes, f = No)
+ # enable package installation without asking (t = Yes, f = No)
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\2.5\MPM" "AutoInstall" "1" ; if only for curent user
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_AUTOINSTALL" "t"
- ; set package repository (MiKTeX's primary package repository)
+ # set package repository (MiKTeX's primary package repository)
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\2.5\MPM" "RemoteRepository" "${MiKTeXRepo}" ; if only for curent user
WriteRegStr HKCU "SOFTWARE\MiKTeX.org\MiKTeX\2.5\MPM" "RepositoryType" "remote" ; if only for curent user
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_REPOSITORY" "${MiKTeXRepo}"
${endif}
- ; enable MiKTeX's automatic package installation
+ # enable MiKTeX's automatic package installation
ExecWait '$LaTeXPath\mpm.com --update-fndb'
${endif} ; end ${if} $Pointer
- ; install Aspell dictionaries
+ # install Aspell dictionaries
${if} $LangCode == "nb_NO"
StrCpy $LangCode "no_NO" ; we only have a norwegian dictionary available
${endif}
Call InstallAspellDictionary ; function from aspell.nsh
- ; configure LyX
- ; Set a path prefix in lyxrc.dist
+ # configure LyX
+ # Set a path prefix in lyxrc.dist
ClearErrors
${if} "$PathPrefix" != ""
Delete "$INSTDIR\Resources\lyxrc.dist"
MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)"
${endif}
- ; Create a batch file to start LyX with the environment variables set
+ # Create a batch file to start LyX with the environment variables set
ClearErrors
Delete "${PRODUCT_BAT}"
FileOpen $R1 "${PRODUCT_BAT}" w
IfErrors 0 +2
MessageBox MB_OK|MB_ICONEXCLAMATION "$(CreateCmdFilesFailed)"
- ; set the preferences file
- ; having one preferences file that is modified to fit the needs isn't possible because the command
- ; ${LineFind} "$INSTDIR\Resources\preferences" "" "-16:-11" "DeleteLines" ; macro from TextFunc.nsh
- ; removes the file permissions for Users, so that it can later not be read (bug in ${LineFind} of TextFunc.nsh)
- ; if not Acrobat or Adobe Reader is used
+ # set the preferences file
+ # having one preferences file that is modified to fit the needs isn't possible because the command
+ # ${LineFind} "$INSTDIR\Resources\preferences" "" "-16:-11" "DeleteLines" ; macro from TextFunc.nsh
+ # removes the file permissions for Users, so that it can later not be read (bug in ${LineFind} of TextFunc.nsh)
+ # if not Acrobat or Adobe Reader is used
${if} $Acrobat == "None" ; clear the entries in the preferences file that define PDFViewWin7 or 8 as viewer
Rename "$INSTDIR\Resources\preferencesGSview" "$INSTDIR\Resources\preferences"
Delete "$INSTDIR\Resources\preferences7"
Delete "$INSTDIR\Resources\preferences8"
${endif}
- ; if Acrobat or Adobe Reader is used
+ # if Acrobat or Adobe Reader is used
${if} $Acrobat == "7" ; clear the entries in the preferences file that define PDFViewWin8 as viewer
Rename "$INSTDIR\Resources\preferences7" "$INSTDIR\Resources\preferences"
Delete "$INSTDIR\Resources\preferences8"
Delete "$INSTDIR\Resources\preferencesGSview"
${endif}
- ; register LyX
+ # register LyX
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
${endif}
- ; register the extension .lyx
+ # register the extension .lyx
${if} $CreateFileAssociations == "true"
${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
${endif}
- ; create the LyX Application Data folder for all users
- ; this folder is automatically created by LyX when it is first started but we want to start LyX with a specific session file,
- ; so we create this folder before LyX starts and copy there the session file
+ # create the LyX Application Data folder for all users
+ # this folder is automatically created by LyX when it is first started but we want to start LyX with a specific session file,
+ # so we create this folder before LyX starts and copy there the session file
Call CreateAppPathSub ; function from LyXUtils.nsh
- ; delete unnecessary files
+ # delete unnecessary files
${if} $DelPythonFiles == "True"
Delete $INSTDIR\bin\python.exe
Delete $INSTDIR\bin\python25.dll
${endif}
RMDir /r $INSTDIR\external
- ; create Uninstaller
+ # create Uninstaller
WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
- ; run LyX's configure script
- ; create a bat-file to start configure in a console window so that the user see the progress
- ; of the configuration and to have a signal when the configuration is ready to start LyX
- ; this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
- ; time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
- ; a batch file is needed because simply calling ExecWait '"$INSTDIR\bin\python.exe" "$INSTDIR\Resources\configure.py"'
- ; creates the config files in $INSTDIR\bin
+ # run LyX's configure script
+ # create a bat-file to start configure in a console window so that the user see the progress
+ # of the configuration and to have a signal when the configuration is ready to start LyX
+ # this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
+ # time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
+ # a batch file is needed because simply calling ExecWait '"$INSTDIR\bin\python.exe" "$INSTDIR\Resources\configure.py"'
+ # creates the config files in $INSTDIR\bin
StrCpy $1 $INSTDIR 2 ; get drive letter
FileOpen $R1 "$INSTDIR\Resources\configLyX.bat" w
FileWrite $R1 'cd $INSTDIR\Resources\$\r$\n\
ExecWait '"$INSTDIR\Resources\configLyX.bat"'
Delete "$INSTDIR\Resources\configLyX.bat"
- ; ask to update MiKTeX
+ # ask to update MiKTeX
${if} $MiKTeXInstalled == "yes"
MessageBox MB_YESNO|MB_ICONINFORMATION "$(MiKTeXInfo)" IDYES UpdateNow IDNO UpdateLater
UpdateNow:
UpdateLater:
${endif}
- ; save MiKTeX's install path to be able to remove LyX's LaTeX-files in the uninstaller
+ # save MiKTeX's install path to be able to remove LyX's LaTeX-files in the uninstaller
FileOpen $R1 "$INSTDIR\Resources\uninstallPaths.dat" w
FileWrite $R1 '$LaTeXPath'
FileClose $R1
Function LatexFolder
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_latex.ini"
- ; generate the installer page
+ # generate the installer page
!insertmacro MUI_HEADER_TEXT "$(EnterLaTeXHeader1)" "$(EnterLaTeXHeader2)"
${if} $LatexName != ""
!insertmacro MUI_INSTALLOPTIONS_WRITE "io_latex.ini" "Field 1" "Text" "$(EnterLaTeXFolder)"
Goto ReadyFolder
${endif}
!insertmacro MUI_INSTALLOPTIONS_READ "$LatexPath" "io_latex.ini" "Field 3" "State"
- ; check if the latex.exe exists in the $LatexPath folder
+ # check if the latex.exe exists in the $LatexPath folder
!insertmacro FileCheck $5 "latex.exe" "$LatexPath"
${if} $5 == "False"
MessageBox MB_RETRYCANCEL "$(InvalidLaTeXFolder)" IDRETRY AgainFolder
-; Language settings for the installer
-; create language code for the Windows system language
+# Language settings for the installer
+# create language code for the Windows system language
-; LangNme is the language name when there exists a LyX translation for this language; used for the menu language dialog and for the Aspell installation
-; LangNmeSys is the Windows system language; used for the Aspell installation
-; LangCdeSys is the ISO 630 language code of the language; used for the Aspell installation
-; LangSysEnc is the Windows codepage for the character encoding of the language; used in lyx.bat to assure that scripts are correctly executed
+# LangNme is the language name when there exists a LyX translation for this language; used for the menu language dialog and for the Aspell installation
+# LangNmeSys is the Windows system language; used for the Aspell installation
+# LangCdeSys is the ISO 630 language code of the language; used for the Aspell installation
+# LangSysEnc is the Windows codepage for the character encoding of the language; used in lyx.bat to assure that scripts are correctly executed
!macro TranslateLangCode LangNme LangNmeSys LangCdeSys LangISOCode LangSysEnc
StrCpy ${LangCdeSys} ""
StrCpy ${LangSysEnc} "1252"
${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 1028
-; StrCpy ${LangCdeSys} "zh"
-; StrCpy ${LangNmeSys} "Chinese"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 1028
+# StrCpy ${LangCdeSys} "zh"
+# StrCpy ${LangNmeSys} "Chinese"
+# ${endif}
${if} ${LangISOCode} = 1029
StrCpy ${LangNme} "Ce\9atina"
StrCpy ${LangSysEnc} "1252"
${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 1041
-; StrCpy ${LangCdeSys} "ja"
-; StrCpy ${LangNmeSys} "Japanese"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 1041
+# StrCpy ${LangCdeSys} "ja"
+# StrCpy ${LangNmeSys} "Japanese"
+# ${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 1042
-; StrCpy ${LangCdeSys} "ko"
-; StrCpy ${LangNmeSys} "Korean"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 1042
+# StrCpy ${LangCdeSys} "ko"
+# StrCpy ${LangNmeSys} "Korean"
+# ${endif}
${if} ${LangISOCode} = 1043
StrCpy ${LangNme} "Nederlands"
StrCpy ${LangSysEnc} "1250"
${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 1052
-; StrCpy ${LangCdeSys} "sq"
-; StrCpy ${LangNmeSys} "Shqip"
-; StrCpy ${LangSysEnc} "1252"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 1052
+# StrCpy ${LangCdeSys} "sq"
+# StrCpy ${LangNmeSys} "Shqip"
+# StrCpy ${LangSysEnc} "1252"
+# ${endif}
${if} ${LangISOCode} = 1053
StrCpy ${LangNme} "Svenska"
StrCpy ${LangSysEnc} "1252"
${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 1054
-; StrCpy ${LangCdeSys} "th"
-; StrCpy ${LangNmeSys} "Thai"
-; StrCpy ${LangSysEnc} "874"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 1054
+# StrCpy ${LangCdeSys} "th"
+# StrCpy ${LangNmeSys} "Thai"
+# StrCpy ${LangSysEnc} "874"
+# ${endif}
${if} ${LangISOCode} = 1055
StrCpy ${LangNme} "Türkçe"
StrCpy ${LangSysEnc} "1257"
${endif}
- ; currently no dictionary available
+ # currently no dictionary available
${if} ${LangISOCode} = 1069
StrCpy ${LangNme} "Euskara"
StrCpy ${LangCdeSys} "eu"
StrCpy ${LangSysEnc} "1252"
${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 1081
-; StrCpy ${LangCdeSys} "hi"
-; StrCpy ${LangNmeSys} "Hindi"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 1081
+# StrCpy ${LangCdeSys} "hi"
+# StrCpy ${LangNmeSys} "Hindi"
+# ${endif}
${if} ${LangISOCode} = 1110
StrCpy ${LangNme} "Galego"
StrCpy ${LangSysEnc} "1252"
${endif}
-; currently no dictionary available
-; ${if} ${LangISOCode} = 2052
-; StrCpy ${LangCdeSys} "zh"
-; StrCpy ${LangNmeSys} "Chinese"
-; ${endif}
+# currently no dictionary available
+# ${if} ${LangISOCode} = 2052
+# StrCpy ${LangCdeSys} "zh"
+# StrCpy ${LangNmeSys} "Chinese"
+# ${endif}
${if} ${LangISOCode} = 2055
StrCpy ${LangCdeSys} "de"
!macroend
-;------------------------------------------
+#------------------------------------------
-; Setting LyX's menu language
+# Setting LyX's menu language
!macro GetLangCode LangCde Name LangEnc
!macroend
-;--------------------
+#--------------------
Function SelectMenuLanguage
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_ui_language.ini"
${if} $LangName == ""
- ; translate NSIS's language code to the language name; macro from lyx_utils.nsh
+ # translate NSIS's language code to the language name; macro from lyx_utils.nsh
!insertmacro TranslateLangCode $LangName $LangNameSys $LangCodeSys $Language $LangSysEncoding
${endif}
Function SelectMenuLanguage_LeaveFunction
!insertmacro MUI_INSTALLOPTIONS_READ $LangName "io_ui_language.ini" "Field 2" "State"
- ; Get the language code; macro from lyx_utils.nsh
+ # Get the language code; macro from lyx_utils.nsh
StrCpy $LangCode ""
!insertmacro GetLangCode $LangCode $LangName $LangEncoding
-; Lyx for Windows, NSIS v2 series installer script
+# Lyx for Windows, NSIS v2 series installer script
-; File LyXWinInstaller.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
+# File LyXWinInstaller.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 Uwe Stöhr based on the work of Angus Leeming and Joost Verburg
-; Full author contact details are available in file CREDITS or copy at
-; http://www.lyx.org/about/credits.php
+# Author Uwe Stöhr based on the work of Angus Leeming and Joost Verburg
+# Full author contact details are available in file CREDITS or copy at
+# http://www.lyx.org/about/credits.php
-; This script requires NSIS 2.22 and newer
-; http://nsis.sourceforge.net/
-;--------------------------------
+# This script requires NSIS 2.22 and newer
+# http://nsis.sourceforge.net/
+#--------------------------------
-; Do a Cyclic Redundancy Check to make sure the installer
-; was not corrupted by the download.
+# 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.
-; SetCompressor lzma
+# Make the installer as small as possible.
+# SetCompressor lzma
-;--------------------------------
-; You should need to change only these macros...
+#--------------------------------
+# You should need to change only these macros...
!define PRODUCT_DIR "D:\LyXPackage1.5"
!define PRODUCT_NAME "LyX"
!define INSTALLER2_EXE "LyXWin150beta1Small-3-09.exe" ; to check later if this installer version is running at the same time
!define VERSION_BITMAP "${PRODUCT_DIR}\icons\lyx_logo_vert${PRODUCT_VERSION_SHORT}.bmp"
-; Replaced by HKLM or HKCU depending on SetShellVarContext.
+# 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 JabRefInstall "external\JabRef-2.2-Setup.exe"
!define JabRefVersion "JabRef 2.2"
!define DVIPostFileDir "${PRODUCT_SOURCEDIR}\external\dvipost"
-; the following variable is needed for a possible CD-version, see InstallActions.nsh, around line 213
-;!define LaTeXPackagesDir "${PRODUCT_SOURCEDIR}\latex"
+# the following variable is needed for a possible CD-version, see InstallActions.nsh, around line 213
+#!define LaTeXPackagesDir "${PRODUCT_SOURCEDIR}\latex"
!define MiKTeXRepo "ftp://ftp.tu-chemnitz.de/pub/tex/systems/win32/miktex/tm/packages/"
!define MiKTeXConfigFolder "MiKTeX\2.5\miktex\config"
!define MiKTeXDeliveredVersion "MiKTeX 2.5"
!define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.5.2580.exe"
-;--------------------------------
-; Make some of the information above available to NSIS.
+#--------------------------------
+# Make some of the information above available to NSIS.
Name "${PRODUCT_NAME}"
OutFile "${INSTALLER_EXE}"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME} ${PRODUCT_VERSION}"
-;--------------------------------
-; Variables
+#--------------------------------
+# Variables
Var LatexPath
Var PythonPath
Var UserList
Var RunNumber
-;--------------------------------
-; load some NSIS libraries
+#--------------------------------
+# load some NSIS libraries
!include "MUI.nsh"
!include "LogicLib.nsh"
!include "FileFunc.nsh"
!include "StrFunc.nsh"
-;!include "TextFunc.nsh"
-;!insertmacro LineFind
+#!include "TextFunc.nsh"
+#!insertmacro LineFind
-; Set of various macros and functions
+# Set of various macros and functions
!include "LyXUtils.nsh"
-; Function to check if needed programs are missing or not
+# Function to check if needed programs are missing or not
!include "MissingPrograms.nsh"
-; Functions for page to set installer language
-; and LyX's menu language
+# Functions for page to set installer language
+# and LyX's menu language
!include "LanguageSettings.nsh"
-; Function for page to install Aspell dictionaries
+# Function for page to install Aspell dictionaries
!include "Aspell.nsh"
-; Use the Abiword macros to help set up associations with the file extension in the Registry.
-; 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.
+# Grabbed from
+# http://abiword.pchasm.org/source/cvs/abiword-cvs/abi/src/pkg/win/setup/NSISv2/abi_util_fileassoc.nsh
!include "abi_util_fileassoc.nsh"
-;--------------------------------
+#--------------------------------
-; Remember the installer language
+# 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_UNICON "${PRODUCT_DIR}\icons\lyx.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${VERSION_BITMAP}"
-; Welcome page
+# Welcome page
!define MUI_WELCOMEPAGE_TEXT "$(WelcomePageText)"
!insertmacro MUI_PAGE_WELCOME
-; Show the license.
+# Show the license.
!insertmacro MUI_PAGE_LICENSE "${PRODUCT_LICENSE_FILE}"
-; Specify the installation directory.
+# Specify the installation directory.
!insertmacro MUI_PAGE_DIRECTORY
-; Specify LyX's menu language.
+# Specify LyX's menu language.
Page custom SelectMenuLanguage SelectMenuLanguage_LeaveFunction
-; Define which components to install.
+# Define which components to install.
!insertmacro MUI_PAGE_COMPONENTS
-; Specify where to install program shortcuts.
+# 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"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "LyX ${PRODUCT_VERSION}"
!insertmacro MUI_PAGE_STARTMENU ${PRODUCT_NAME} $StartmenuFolder
-; Check for needed programs
+# Check for needed programs
Page custom MissingProgramsPage MissingProgramsPage_LeaveFunction
-; Watch the components being installed.
+# Watch the components being installed.
!insertmacro MUI_PAGE_INSTFILES
-; Finish page
+# Finish page
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)"
!define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProduct"
!insertmacro MUI_PAGE_FINISH
-; The uninstaller.
+# The uninstaller.
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
-;--------------------------------
-; Languages
+#--------------------------------
+# Languages
!insertmacro MUI_LANGUAGE "English" # first language is the default language
!insertmacro MUI_LANGUAGE "Danish"
LicenseData "$(LyXLicenseData)"
-;--------------------------------
-; Reserve Files
+#--------------------------------
+# Reserve Files
-; These files are inserted before other files in the data block
+# These files are inserted before other files in the data block
!insertmacro MUI_RESERVEFILE_LANGDLL
ReserveFile "io_ui_language.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
-;--------------------------------
-; Installer sections
+#--------------------------------
+# Installer sections
Section "!${PRODUCT_NAME}" SecCore
SectionIn RO
StrCpy $InstallJabRef "true"
SectionEnd
-; Section descriptions
+# Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
!insertmacro MUI_DESCRIPTION_TEXT ${SecAllUsers} "$(SecAllUsersDescription)"
!include "InstallActions-complete.nsh"
-;--------------------------------
-; This hook function is called internally by NSIS on installer startup
+#--------------------------------
+# This hook function is called internally by NSIS on installer startup
Function .onInit
- ; set the installer language to the Windows locale language
+ # set the installer language to the Windows locale language
System::Call "kernel32::GetUserDefaultLangID()i.a"
- ; Check that the installer is not currently running
+ # Check that the installer is not currently running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${INSTALLER_EXE}.Instance") i .r1 ?e'
Pop $R0
${if} $R0 != "0"
Abort
${endif}
- ; Check if LyX is already installed
+ # Check if LyX is already installed
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "Publisher"
${if} $0 != ""
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
- ; Default settings
- ; These can be reset to "all" in section SecAllUsers.
+ # 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.
+ # This can be reset to "true" in section SecDesktop.
StrCpy $CreateDesktopIcon "false"
StrCpy $CreateFileAssociations "false"
- ; If the user does *not* have administrator privileges, abort
+ # If the user does *not* have administrator privileges, abort
StrCpy $Answer ""
StrCpy $UserName ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
Abort
${endif}
- ; check which programs are installed or not
+ # check which programs are installed or not
Call MissingPrograms ; function from MissingPrograms.nsh
- ; don't let the installer sections appear when the programs are already installed
+ # don't let the installer sections appear when the programs are already installed
${if} $PSVPath != ""
SectionSetText 4 "" ; hides the corresponding uninstaller section, ${SecInstGSview}
${endif}
ClearErrors
FunctionEnd
-;--------------------------------
+#--------------------------------
Function LaunchProduct
Exec ${PRODUCT_BAT}
FunctionEnd
-;--------------------------------
+#--------------------------------
-;Function DeleteLines
-; StrCpy $0 SkipWrite
-; Push $0
-;FunctionEnd
+#Function DeleteLines
+# StrCpy $0 SkipWrite
+# Push $0
+#FunctionEnd
-;--------------------------------
-; The Uninstaller
+#--------------------------------
+# The Uninstaller
Function un.onInit
- ; Check that LyX is not currently running
+ # Check that LyX is not currently running
FindProcDLL::FindProc "lyx.exe"
${if} $R0 == "1"
MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
Abort
${endif}
- ; Ascertain whether the user has sufficient privileges to uninstall.
+ # Ascertain whether the user has sufficient privileges to uninstall.
SetShellVarContext current
ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
${endif}
${endif}
- ; If the user does *not* have administrator privileges, abort
+ # If the user does *not* have administrator privileges, abort
StrCpy $Answer ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
${if} $Answer == "yes"
Abort
${endif}
- ; Macro to investigate name of LyX's preferences folders to be able remove them
+ # Macro to investigate name of LyX's preferences folders to be able remove them
!insertmacro UnAppPreSuff $AppPre $AppSuff ; macro from LyXUtils.nsh
- ; test if Aspell was installed together with LyX
+ # test if Aspell was installed together with LyX
ReadRegStr $0 HKLM "Software\Aspell" "OnlyWithLyX" ; special entry to test if it was installed with LyX
${if} $0 == "Yes"
SectionSetText 2 "Aspell" ; names the corersponding uninstaller section (has the index "2" as it is the third section in Uninstall.nsh)
SectionSetText 2 "" ; hides the corresponding uninstaller section
${endif}
- ; test if MiKTeX was installed together with LyX
+ # test if MiKTeX was installed together with LyX
ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
${if} $0 == "Yes"
SectionSetText 3 "MiKTeX" ; names the corersponding uninstaller section
SectionSetText 3 "" ; hides the corresponding uninstaller section
${endif}
- ; test if JabRef was installed together with LyX
+ # test if JabRef was installed together with LyX
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "OnlyWithLyX"
${if} $0 == "Yes"
SectionSetText 4 "JabRef" ; names the corersponding uninstaller section
FunctionEnd
-;----------------------
-;Installer sections
+#----------------------
+#Installer sections
!include "Uninstall.nsh"
-; eof
+# eof
-; Lyx for Windows, NSIS v2 series installer script
+# Lyx for Windows, NSIS v2 series installer script
-; File LyXWinInstaller.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
+# File LyXWinInstaller.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 Uwe Stöhr based on the work of Angus Leeming and Joost Verburg
-; Full author contact details are available in file CREDITS or copy at
-; http://www.lyx.org/about/credits.php
+# Author Uwe Stöhr based on the work of Angus Leeming and Joost Verburg
+# Full author contact details are available in file CREDITS or copy at
+# http://www.lyx.org/about/credits.php
-; This script requires NSIS 2.22 and newer
-; http://nsis.sourceforge.net/
-;--------------------------------
+# This script requires NSIS 2.22 and newer
+# http://nsis.sourceforge.net/
+#--------------------------------
-; Do a Cyclic Redundancy Check to make sure the installer
-; was not corrupted by the download.
+# 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.
-; SetCompressor lzma
+# Make the installer as small as possible.
+# SetCompressor lzma
-;--------------------------------
-; You should need to change only these macros...
+#--------------------------------
+# You should need to change only these macros...
!define PRODUCT_DIR "D:\LyXPackage1.5"
!define PRODUCT_NAME "LyX"
!define INSTALLER2_EXE "LyXWin150beta1Complete-3-09.exe" ; to check later if this installer version is running at the same time
!define VERSION_BITMAP "${PRODUCT_DIR}\icons\lyx_logo_vert${PRODUCT_VERSION_SHORT}.bmp"
-; Replaced by HKLM or HKCU depending on SetShellVarContext.
+# 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 MiKTeXConfigFolder "MiKTeX\2.5\miktex\config"
!define MiKTeXDeliveredVersion "MiKTeX not included"
-;--------------------------------
-; Make some of the information above available to NSIS.
+#--------------------------------
+# Make some of the information above available to NSIS.
Name "${PRODUCT_NAME}"
OutFile "${INSTALLER_EXE}"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME} ${PRODUCT_VERSION}"
-;--------------------------------
-; Variables
+#--------------------------------
+# Variables
Var LatexPath
Var PythonPath
Var UserList
Var RunNumber
-;--------------------------------
-; load some NSIS libraries
+#--------------------------------
+# load some NSIS libraries
!include "MUI.nsh"
!include "LogicLib.nsh"
!include "FileFunc.nsh"
!include "StrFunc.nsh"
-;!include "TextFunc.nsh"
-;!insertmacro LineFind
+#!include "TextFunc.nsh"
+#!insertmacro LineFind
-; Set of various macros and functions
+# Set of various macros and functions
!include "LyXUtils.nsh"
-; Function to check if needed programs are missing or not
+# Function to check if needed programs are missing or not
!include "MissingPrograms.nsh"
-; Function for page to manually select LaTeX's installation folder
+# Function for page to manually select LaTeX's installation folder
!include "LaTeXFolder.nsh"
-; Functions for page to set installer language
-; and LyX's menu language
+# Functions for page to set installer language
+# and LyX's menu language
!include "LanguageSettings.nsh"
-; Function for page to install Aspell dictionaries
+# Function for page to install Aspell dictionaries
!include "Aspell.nsh"
-; Use the Abiword macros to help set up associations with the file extension in the Registry.
-; 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.
+# Grabbed from
+# http://abiword.pchasm.org/source/cvs/abiword-cvs/abi/src/pkg/win/setup/NSISv2/abi_util_fileassoc.nsh
!include "abi_util_fileassoc.nsh"
-;--------------------------------
+#--------------------------------
-; Remember the installer language
+# 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_UNICON "${PRODUCT_DIR}\icons\lyx.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${VERSION_BITMAP}"
-; Welcome page
+# Welcome page
!define MUI_WELCOMEPAGE_TEXT "$(WelcomePageText)"
!insertmacro MUI_PAGE_WELCOME
-; Show the license.
+# Show the license.
!insertmacro MUI_PAGE_LICENSE "${PRODUCT_LICENSE_FILE}"
-; Specify the installation directory.
+# Specify the installation directory.
!insertmacro MUI_PAGE_DIRECTORY
-; Specify LyX's menu language.
+# Specify LyX's menu language.
Page custom SelectMenuLanguage SelectMenuLanguage_LeaveFunction
-; Define which components to install.
+# Define which components to install.
!insertmacro MUI_PAGE_COMPONENTS
-; Specify where to install program shortcuts.
+# 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"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "LyX ${PRODUCT_VERSION}"
!insertmacro MUI_PAGE_STARTMENU ${PRODUCT_NAME} $StartmenuFolder
-; Select latex.exe manually
+# Select latex.exe manually
Page custom LatexFolder LatexFolder_LeaveFunction
-; Check for needed programs
+# Check for needed programs
Page custom MissingProgramsPage MissingProgramsPage_LeaveFunction
-; Watch the components being installed.
+# Watch the components being installed.
!insertmacro MUI_PAGE_INSTFILES
-; Finish page
+# Finish page
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)"
!define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProduct"
!insertmacro MUI_PAGE_FINISH
-; The uninstaller.
+# The uninstaller.
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
-;--------------------------------
-; Languages
+#--------------------------------
+# Languages
!insertmacro MUI_LANGUAGE "English" # first language is the default language
!insertmacro MUI_LANGUAGE "Danish"
LicenseData "$(LyXLicenseData)"
-;--------------------------------
-; Reserve Files
+#--------------------------------
+# Reserve Files
-; These files are inserted before other files in the data block
+# These files are inserted before other files in the data block
!insertmacro MUI_RESERVEFILE_LANGDLL
ReserveFile "io_ui_language.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
-;--------------------------------
-; Installer sections
+#--------------------------------
+# Installer sections
Section "!${PRODUCT_NAME}" SecCore
SectionIn RO
StrCpy $CreateDesktopIcon "true"
SectionEnd
-; Section descriptions
+# Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
!insertmacro MUI_DESCRIPTION_TEXT ${SecAllUsers} "$(SecAllUsersDescription)"
!include "InstallActions-small.nsh"
-;--------------------------------
-; This hook function is called internally by NSIS on installer startup
+#--------------------------------
+# This hook function is called internally by NSIS on installer startup
Function .onInit
- ; set the installer language to the Windows locale language
+ # set the installer language to the Windows locale language
System::Call "kernel32::GetUserDefaultLangID()i.a"
- ; Check that the installer is not currently running
+ # Check that the installer is not currently running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${INSTALLER_EXE}.Instance") i .r1 ?e'
Pop $R0
${if} $R0 != "0"
Abort
${endif}
- ; Check if LyX is already installed
+ # Check if LyX is already installed
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "Publisher"
${if} $0 != ""
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
- ; Default settings
- ; These can be reset to "all" in section SecAllUsers.
+ # 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.
+ # This can be reset to "true" in section SecDesktop.
StrCpy $CreateDesktopIcon "false"
StrCpy $CreateFileAssociations "false"
- ; If the user does *not* have administrator privileges, abort
+ # If the user does *not* have administrator privileges, abort
StrCpy $Answer ""
StrCpy $UserName ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
Abort
${endif}
- ; check which programs are installed or not
+ # check which programs are installed or not
Call MissingPrograms ; function from MissingPrograms.nsh
- ; used later in the function LatexFolder
+ # used later in the function LatexFolder
StrCpy $State "0"
ClearErrors
FunctionEnd
-;--------------------------------
+#--------------------------------
Function LaunchProduct
Exec ${PRODUCT_BAT}
FunctionEnd
-;--------------------------------
+#--------------------------------
-;Function DeleteLines
-; StrCpy $0 SkipWrite
-; Push $0
-;FunctionEnd
+#Function DeleteLines
+# StrCpy $0 SkipWrite
+# Push $0
+#FunctionEnd
-;--------------------------------
-; The Uninstaller
+#--------------------------------
+# The Uninstaller
Function un.onInit
- ; Check that LyX is not currently running
+ # Check that LyX is not currently running
FindProcDLL::FindProc "lyx.exe"
${if} $R0 == "1"
MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
Abort
${endif}
- ; Ascertain whether the user has sufficient privileges to uninstall.
+ # Ascertain whether the user has sufficient privileges to uninstall.
SetShellVarContext current
ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
${endif}
${endif}
- ; If the user does *not* have administrator privileges, abort
+ # If the user does *not* have administrator privileges, abort
StrCpy $Answer ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
${if} $Answer == "yes"
Abort
${endif}
- ; Macro to investigate name of LyX's preferences folders to be able remove them
+ # Macro to investigate name of LyX's preferences folders to be able remove them
!insertmacro UnAppPreSuff $AppPre $AppSuff ; macro from LyXUtils.nsh
- ; test if Aspell was installed together with LyX
+ # test if Aspell was installed together with LyX
ReadRegStr $0 HKLM "Software\Aspell" "OnlyWithLyX" ; special entry to test if it was installed with LyX
${if} $0 == "Yes"
SectionSetText 2 "Aspell" ; names the corersponding uninstaller section (has the index "2" as it is the third section in Uninstall.nsh)
SectionSetText 2 "" ; hides the corresponding uninstaller section
${endif}
- ; test if MiKTeX was installed together with LyX
+ # test if MiKTeX was installed together with LyX
ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
${if} $0 == "Yes"
SectionSetText 3 "MiKTeX" ; names the corersponding uninstaller section
SectionSetText 3 "" ; hides the corresponding uninstaller section
${endif}
- ; ignore JabRef because this could only be installed with the complete installer version
+ # ignore JabRef because this could only be installed with the complete installer version
SectionSetText 4 "" ; hides the corresponding uninstaller section
StrCpy $JabRefInstalled ""
FunctionEnd
-;----------------------
-;Installer sections
+#----------------------
+#Installer sections
!include "Uninstall.nsh"
-; eof
+# eof
-; This script contains the following functions:
-;
-; - LaTeXCheck (check installed LaTeX-system), uses:
-; StrPointer
-; StrPoint
-; RevStrPointer
-; RevStrPoint
-;
-; - un.DelAppPathSub and UnAppPreSuff, (delete the folder ~\Documents and Settings\username\Application Data\LyX for all users), uses:
-; un.GetParent
-; un.GetUsers
-; un.StrPoint
-; StrPointer
-; StrPoint
-; UnAppPreSuff
-;
-; - CreateAppPathSub and AppPreSuff, (creates the folder ~\Documents and Settings\username\Application Data\LyX for all users), uses:
-; GetParent
-; GetUsers
-; StrPointer
-; StrPoint
-; UnAppPreSuff
-;
-; - IsUserAdmin (checks if user is admin)
-;
-; - FileCheck (checks if a given file exists)
-;
-; - EditorCheck (check for installed editors)
-;
-;--------------------------
+# This script contains the following functions:
+#
+# - LaTeXCheck (check installed LaTeX-system), uses:
+# StrPointer
+# StrPoint
+# RevStrPointer
+# RevStrPoint
+#
+# - un.DelAppPathSub and UnAppPreSuff, (delete the folder ~\Documents and Settings\username\Application Data\LyX for all users), uses:
+# un.GetParent
+# un.GetUsers
+# un.StrPoint
+# StrPointer
+# StrPoint
+# UnAppPreSuff
+#
+# - CreateAppPathSub and AppPreSuff, (creates the folder ~\Documents and Settings\username\Application Data\LyX for all users), uses:
+# GetParent
+# GetUsers
+# StrPointer
+# StrPoint
+# UnAppPreSuff
+#
+# - IsUserAdmin (checks if user is admin)
+#
+# - FileCheck (checks if a given file exists)
+#
+# - EditorCheck (check for installed editors)
+#
+#--------------------------
!macro StrPointer FindStr SearchStr Pointer
- ; searches for a string/character (SearchStr) in another string (FindStr)
- ; and returns the number of the character in the FindStr where the SearchStr was found (Pointer)
- ; if nothing was found or the search is impossible the Pointer is set to -1
+ # searches for a string/character (SearchStr) in another string (FindStr)
+ # and returns the number of the character in the FindStr where the SearchStr was found (Pointer)
+ # if nothing was found or the search is impossible the Pointer is set to -1
StrLen $R2 ${SearchStr}
StrLen $R4 ${FindStr}
!macroend
-;--------------------------------
+#--------------------------------
Function StrPoint
!insertmacro StrPointer $String $Search $Pointer
FunctionEnd
-;--------------------------------
+#--------------------------------
!macro RevStrPointer FindStr SearchStr Pointer
- ; searches for a string/character (SearchStr) in another string (FindStr) in reverse order
- ; and returns the number of the character in the FindStr where the SearchStr was found (Pointer)
- ; if nothing was found or the search is impossible the Pointer is set to +1
+ # searches for a string/character (SearchStr) in another string (FindStr) in reverse order
+ # and returns the number of the character in the FindStr where the SearchStr was found (Pointer)
+ # if nothing was found or the search is impossible the Pointer is set to +1
StrLen $R2 ${SearchStr}
StrLen $R4 ${FindStr}
!macroend
-;--------------------------------
+#--------------------------------
Function RevStrPoint
!insertmacro RevStrPointer $String $Search $Pointer
FunctionEnd
-;--------------------------------
+#--------------------------------
!macro AppPreSuff AppPre AppSuff
- ; the APPDATA path has always the following structure:
- ; C:\Documents and Settings\username\Application Data
- ; this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
- ; and the "Application Data" substring into the variable "AppSuff"
+ # the APPDATA path has always the following structure:
+ # C:\Documents and Settings\username\Application Data
+ # this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
+ # and the "Application Data" substring into the variable "AppSuff"
StrCpy $String "$APPDATA"
StrCpy $Search "\"
!macroend
-;--------------------------------
+#--------------------------------
Function GetParent
- ; deletes a subfolder of the APPDATA path for all users
- ; used by the function "un.getUsers"
+ # deletes a subfolder of the APPDATA path for all users
+ # used by the function "un.getUsers"
Exch $R0
Push $R1
FunctionEnd
-;--------------------------------
+#--------------------------------
Function GetUsers
- ; reads the subfolders of the "Documents and Settings" folder to get a list of the users
+ # reads the subfolders of the "Documents and Settings" folder to get a list of the users
StrCpy $R3 ""
Push "$PROFILE"
FunctionEnd
-;--------------------------------
+#--------------------------------
Function un.GetParent
- ; deletes a subfolder of the APPDATA path for all users
- ; used by the function "un.getUsers"
+ # deletes a subfolder of the APPDATA path for all users
+ # used by the function "un.getUsers"
Exch $R0
Push $R1
FunctionEnd
-;--------------------------------
+#--------------------------------
Function un.GetUsers
- ; reads the subfolders of the "Documents and Settings" folder to get a list of the users
+ # reads the subfolders of the "Documents and Settings" folder to get a list of the users
StrCpy $R3 ""
Push "$PROFILE"
FunctionEnd
-;--------------------------------
+#--------------------------------
Function un.StrPoint
!insertmacro StrPointer $String $Search $Pointer
FunctionEnd
-;--------------------------------
+#--------------------------------
!macro UnAppPreSuff AppPre AppSuff
- ; the APPDATA path has always the following structure:
- ; C:\Documents and Settings\username\Application Data
- ; this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
- ; and the "Application Data" substring into the variable "AppSuff"
+ # the APPDATA path has always the following structure:
+ # C:\Documents and Settings\username\Application Data
+ # this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
+ # and the "Application Data" substring into the variable "AppSuff"
StrCpy $String "$APPDATA"
StrCpy $Search "\"
!macroend
-;--------------------------------
+#--------------------------------
Function un.DelAppPathSub
- ; deletes a subfolder of the APPDATA path for all users
+ # deletes a subfolder of the APPDATA path for all users
- ; get list of all users
+ # get list of all users
Push $R0
Push $R1
Push $R2
Pop $R1
Pop $R0
- ; the usernames in the list of all users is separated by "|"
+ # the usernames in the list of all users is separated by "|"
loop:
StrCpy $String "$UserList"
StrCpy $Search "|"
StrCpy $0 $UserList $Pointer ; $0 contains now the username
IntOp $Pointer $Pointer + 1 ; jump after the "|"
StrCpy $UserList $UserList "" $Pointer ; cut off the first username in the list
- ; generate the string for the current user
- ; AppPre and AppSuff are generated in the macro "AppPreSuff"
+ # generate the string for the current user
+ # AppPre and AppSuff are generated in the macro "AppPreSuff"
StrCpy $AppPath "$AppPre\$0\$AppSuff\${PRODUCT_SUBFOLDER}"
RMDir /r $AppPath ; delete the folder
Goto loop
FunctionEnd
-;--------------------------------
+#--------------------------------
Function CreateAppPathSub
- ; creates a subfolder of the APPDATA path for all users
+ # creates a subfolder of the APPDATA path for all users
- ; get folder names
+ # get folder names
!insertmacro AppPreSuff $AppPre $AppSuff
- ; get list of all users
+ # get list of all users
Push $R0
Push $R1
Push $R2
Pop $R1
Pop $R0
- ; the usernames in the list of all users is separated by "|"
+ # the usernames in the list of all users is separated by "|"
loop:
StrCpy $String "$UserList"
StrCpy $Search "|"
StrCpy $0 $UserList $Pointer ; $0 contains now the username
IntOp $Pointer $Pointer + 1 ; jump after the "|"
StrCpy $UserList $UserList "" $Pointer ; cut off the first username in the list
- ; generate the string for the current user
- ; AppPre and AppSuff are generated in the macro "AppPreSuff"
+ # generate the string for the current user
+ # AppPre and AppSuff are generated in the macro "AppPreSuff"
StrCpy $AppPath "$AppPre\$0\$AppSuff\${PRODUCT_SUBFOLDER}"
CreateDirectory $AppPath ; create the folder
CopyFiles "$INSTDIR\Resources\session" "$AppPath"
FunctionEnd
-;--------------------------------
+#--------------------------------
!macro IsUserAdmin Result Name
!macroend
-;--------------------------------
+#--------------------------------
!macro FileCheck Result FileName FilePath
- ; checks if a file exists, returns "True" or "False"
+ # checks if a file exists, returns "True" or "False"
Push $0
Push $1
!macroend
-;------------------------------------------
+#------------------------------------------
Function LaTeXCheck
- ; searches the string "$Search" in the string "$String" and extracts the path around it
- ; the extracted path is checked if the file "latex.exe" is in it
+ # searches the string "$Search" in the string "$String" and extracts the path around it
+ # the extracted path is checked if the file "latex.exe" is in it
StartCheck:
StrLen $3 $String
StrCpy $String $String $Pointer
${endif}
StrCpy $LatexPath "$LatexPath$String"
- ; check if the latex.exe exists in the $LatexPath folder
+ # check if the latex.exe exists in the $LatexPath folder
!insertmacro FileCheck $5 "latex.exe" "$LatexPath"
${if} $5 == "False" ; delete the entry with the wrong path to the latex.exe and try again
StrCpy $LatexPath ""
FunctionEnd
-;------------------------------------------
+#------------------------------------------
Function EditorCheck
- ; test if an editor with syntax-highlighting for LaTeX-files is installed
- ; (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
+ # test if an editor with syntax-highlighting for LaTeX-files is installed
+ # (check for jEdit, PSPad, WinShell, ConTEXT, Crimson Editor, Vim, TeXnicCenter, LaTeXEditor, WinEdt, LEd, WinTeX)
StrCpy $EditorPath ""
StrCpy $0 ""
- ; check for jEdit
+ # check for jEdit
ReadRegStr $EditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\jEdit_is1" "InstallLocation"
${if} $EditorPath != ""
StrCpy $EditorPath $EditorPath -1 ; remove "\" from the end of the string
${endif}
- ; check for PSPad
+ # check for PSPad
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for WinShell
+ # check for WinShell
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for ConTEXT
+ # check for ConTEXT
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ConTEXTEditor_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for Crimson Editor
+ # check for Crimson Editor
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Crimson Editor" "UninstallString"
${if} $0 != ""
StrCpy $0 $0 -14 ; remove "\uninstall.exe"
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for Vim 6.x
+ # check for Vim 6.x
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Classes\Applications\gvim.exe\shell\edit\command" ""
${if} $0 != ""
StrCpy $0 $0 -13 ; remove "gvim.exe "%1""
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for Vim 7.0
+ # check for Vim 7.0
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0" "UninstallString"
${if} $0 != ""
StrCpy $0 $0 -18 ; remove "\uninstall-gui.exe"
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for TeXnicCenter
+ # check for TeXnicCenter
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "Inno Setup: App Path"
${if} $0 != ""
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for LaTeXEditor
+ # check for LaTeXEditor
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LaTeX Editor" "InstallLocation"
${if} $0 != ""
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for WinEdt
+ # check for WinEdt
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for LEd
+ # check for LEd
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LEd_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $EditorPath "$EditorPath;$0"
${endif}
- ; check for WinTeX
+ # check for WinTeX
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinTeX XP" "DisplayIcon"
${if} $0 != ""
StrCpy $MissedProg "False"
- ; test if MiKTeX is installed
- ; read the PATH variable via the registry because NSIS' "$%Path%" variable is not updated when the PATH changes
+ # test if MiKTeX is installed
+ # read the PATH variable via the registry because NSIS' "$%Path%" variable is not updated when the PATH changes
ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
StrCpy $Search "miktex"
Call LaTeXCheck ; sets the path to the latex.exe to $LatexPath ; function from LyXUtils.nsh
- ; check if MiKTeX 2.4 or 2.5 is installed
+ # check if MiKTeX 2.4 or 2.5 is installed
StrCpy $String ""
ReadRegStr $String HKLM "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root"
${if} $String != ""
${endif}
${if} $LatexPath == "" ; check if MiKTeX is installed only for the current user
- ; check for MiKTeX 2.5
+ # check for MiKTeX 2.5
ReadRegStr $String HKCU "Environment" "Path"
StrCpy $Search "miktex"
Call LaTeXCheck ; function from LyXUtils.nsh
${if} $LatexPath != ""
StrCpy $MiKTeXUser "HKCU" ; needed later to for a message about MiKTeX's install folder write permissions, see InstallActions-*.nsh
${endif}
- ; check for MiKTeX 2.4
+ # check for MiKTeX 2.4
StrCpy $String ""
ReadRegStr $String HKCU "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root"
${if} $String != ""
${endif}
${endif}
- ; test if TeXLive is installed
- ; as described at TeXLives' homepage there should be an entry in the PATH
+ # test if TeXLive is installed
+ # as described at TeXLives' homepage there should be an entry in the PATH
${if} $LatexPath == ""
ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path"
StrCpy $Search "TeXLive"
Call LaTeXCheck ; function from LyXUtils.nsh
${endif}
- ; check for the current user Path variable (the case when it is a live CD/DVD)
+ # check for the current user Path variable (the case when it is a live CD/DVD)
${if} $LatexPath == ""
ReadRegStr $String HKCU "Environment" "Path"
StrCpy $Search "texlive"
StrCpy $2 "TeXLive"
Call LaTeXCheck ; function from LyXUtils.nsh
${endif}
- ; check if the variable TLroot exists (the case when it is installed using the program "tlpmgui")
+ # check if the variable TLroot exists (the case when it is installed using the program "tlpmgui")
${if} $LatexPath == ""
ReadRegStr $String HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "TLroot"
${if} $String == ""
ReadRegStr $String HKCU "Environment" "TLroot" ; the case when installed without admin permissions
${endif}
StrCpy $LatexPath "$String\bin\win32"
- ; check if the latex.exe exists in the $LatexPath folder
+ # check if the latex.exe exists in the $LatexPath folder
!insertmacro FileCheck $5 "latex.exe" "$LatexPath" ; macro from LyXUtils.nsh
${if} $5 == "False"
StrCpy $LatexPath ""
StrCpy $LaTeXName "TeXLive"
${endif}
- ; test if Ghostscript is installed
+ # test if Ghostscript is installed
GSloop:
EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
${if} $1 == ""
StrCpy $MissedProg "True"
${endif}
- ; test if Imagemagick is installed
+ # test if Imagemagick is installed
ReadRegStr $ImageMagickPath HKLM "Software\ImageMagick\Current" "BinPath"
${if} $ImageMagickPath == ""
StrCpy $MissedProg "True"
${endif}
- ; test if Aiksaurus is installed
+ # test if Aiksaurus is installed
!insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" ; macro from LyXUtils.nsh
${if} $5 == "True"
StrCpy $AiksaurusPath "${AiksaurusDir}"
${endif}
-; ReadRegStr $AiksaurusPath HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "AIK_DATA_DIR"
+# ReadRegStr $AiksaurusPath HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "AIK_DATA_DIR"
- ; test if Aspell is installed
+ # test if Aspell is installed
StrCpy $5 ""
ReadRegStr $5 HKCU "SOFTWARE\Aspell" "Base Path"
${if} $5 == ""
StrCpy $AspellPath "$5"
${endif}
- ; test if Python is installed
- ; only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
- ; with outdated Python interpreters
+ # test if Python is installed
+ # only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
+ # with outdated Python interpreters
ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
${if} $PythonPath != ""
StrCpy $0 $PythonPath "" -1 ; remove the "\" at the end
StrCpy $DelPythonFiles "True"
${endif}
- ; test if Acrobat or Adobe Reader is used as PDF-viewer
+ # test if Acrobat or Adobe Reader is used as PDF-viewer
ReadRegStr $String HKCR ".pdf" ""
${if} $String != "AcroExch.Document" ; this name is only used by Acrobat and Adobe Reader
StrCpy $Acrobat "None"
${endif}
${endif}
- ; test if a PostScript-viewer is installed, only check for GSview32
+ # test if a PostScript-viewer is installed, only check for GSview32
StrCpy $PSVPath ""
ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
- ; test if an editor with syntax-highlighting for LaTeX-files is installed (function in LyXUtils.nsh)
+ # test if an editor with syntax-highlighting for LaTeX-files is installed (function in LyXUtils.nsh)
Call EditorCheck ; function from LyXUtils.nsh
- ; test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
+ # test if an image editor is installed (due to LyX's bug 2654 first check for GIMP)
StrCpy $ImageEditorPath ""
ReadRegStr $ImageEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" "DisplayIcon"
${if} $ImageEditorPath != ""
StrCpy $ImageEditorPath "$ImageEditorPath" -13 ; delete "\gimp-2.x.exe"
${endif}
- ; check for Photoshop
+ # check for Photoshop
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\Photoshop.exe" "Path"
${if} $0 != ""
StrCpy $0 "$0" -1 ; delete the last "\"
${endif}
${endif}
- ; test if the BibTeX-editor JabRef is installed
+ # test if the BibTeX-editor JabRef is installed
StrCpy $BibTeXEditorPath ""
ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef 2.1" "UninstallString"
${if} $BibTeXEditorPath == ""
Function MissingProgramsPage
- ; generate the installer page - re-read empty page first
+ # generate the installer page - re-read empty page first
StrCpy $0 "2"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_missing_progs.ini"
!insertmacro MUI_HEADER_TEXT "$(MissProgHeader)" ""
-; Uninstall sections
+# Uninstall sections
Section "un.LyX" un.SecUnProgramFiles
SectionIn RO
- ; delete LaTeX class files that were installed together with LyX
+ # delete LaTeX class files that were installed together with LyX
FileOpen $R5 "$INSTDIR\Resources\uninstallPaths.dat" r
FileRead $R5 $LatexPath
FileClose $R5
ExecWait "$LatexPath\initexmf --update-fndb"
${endif}
- ; delete LyX's installation folder
+ # delete LyX's installation folder
RMDir /r $INSTDIR
- ; delete start menu folder
+ # delete start menu folder
ReadRegStr $0 ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu"
RMDir /r "$0"
- ; delete desktop icon
+ # delete desktop icon
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
- ; delete registry entries
+ # delete registry entries
DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
DeleteRegKey ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
DeleteRegKey HKCR "Applications\lyx.exe"
DeleteRegKey HKCR "Applications\lyx.bat"
- ; Aiksaurus
+ # Aiksaurus
!insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" ; macro from LyXUtils.nsh
${if} $5 == "True"
RMDir /r "${AiksaurusDir}"
${endif}
-; StrCpy $0 ""
-; ReadRegStr $0 HKLM "Software\Aiksaurus" "OnlyWithLyX" ; special entry to test if it was installed with LyX
-; ${if} $0 == "Yes"
-; ; unregister Aiksaurus
-; ReadRegStr $1 HKLM "Software\Aiksaurus" "Data Path"
-; RMDir /r "$1"
-; DeleteRegKey HKLM "SOFTWARE\Aiksaurus"
-; ${endif}
-
- ; ImageMagick
+# StrCpy $0 ""
+# ReadRegStr $0 HKLM "Software\Aiksaurus" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+# ${if} $0 == "Yes"
+# ; unregister Aiksaurus
+# ReadRegStr $1 HKLM "Software\Aiksaurus" "Data Path"
+# RMDir /r "$1"
+# DeleteRegKey HKLM "SOFTWARE\Aiksaurus"
+# ${endif}
+
+ # ImageMagick
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\ImageMagick" "OnlyWithLyX" ; special entry to test if it was installed with LyX
${if} $0 == "Yes"
- ; unregister ImageMagick
+ # unregister ImageMagick
DeleteRegValue HKLM "SOFTWARE\Classes\Applications" "AutoRun"
DeleteRegKey HKLM "SOFTWARE\ImageMagick"
${endif}
- ; Ghostscript and GSview
+ # Ghostscript and GSview
StrCpy $0 ""
StrCpy $5 ""
ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" ; special entry to test if it was installed with LyX
${if} $0 == "Yes"
- ; unregister Ghostscript
+ # unregister Ghostscript
DeleteRegKey HKLM "SOFTWARE\GPL Ghostscript"
- ; test if GSview is installed
+ # test if GSview is installed
EnumRegValue $5 HKLM "Software\Ghostgum\GSview" 0
${if} $5 != ""
- ; unregister GSview
+ # unregister GSview
MessageBox MB_ICONINFORMATION|MB_OK "$(UnGSview)"
ReadRegStr $3 HKLM "Software\Ghostgum\GSview" "$5"
ReadRegStr $4 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GSview $5" "UninstallString"
${endif}
${endif}
- ; MiKTeX specific LyX setting
+ # MiKTeX specific LyX setting
DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_AUTOINSTALL"
DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_REPOSITORY"
- ; remove extension .lyx
+ # remove extension .lyx
${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
DeleteRegKey HKCR "${PRODUCT_NAME}"
- ; clear info that programs were installed together with LyX
+ # clear info that programs were installed together with LyX
DeleteRegValue HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
DeleteRegValue HKLM "Software\Aspell" "OnlyWithLyX"
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "OnlyWithLyX"
SectionEnd
-;---------------------------------
-; user preferences
+#---------------------------------
+# user preferences
Section "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
- ; remove LyX's config files
+ # remove LyX's config files
Call un.DelAppPathSub ; function from LyXUtils.nsh
SectionEnd
-;---------------------------------
-; Aspell
+#---------------------------------
+# Aspell
Section "un.Aspell" un.SecUnAspell
${if} $AspellInstallYes == "Aspell" ; only uninstall Aspell when it was installed together with LyX
SectionEnd
-;---------------------------------
-; MiKTeX
+#---------------------------------
+# MiKTeX
Section "un.MiKTeX" un.SecUnMiKTeX
${if} $MiKTeXInstalled == "MiKTeX" ; only uninstall MiKTeX when it was installed together with LyX
SectionEnd
-;---------------------------------
-; JabRef
+#---------------------------------
+# JabRef
Section "un.JabRef" un.SecUnJabRef
${if} $JabRefInstalled == "JabRef" ; only uninstall JabRef when it was installed together with LyX
SectionEnd
-;---------------------------------
-; Section descriptions
+#---------------------------------
+# Section descriptions
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnAspell} "$(SecUnAspellDescription)"
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
-;Title AbiWord for Windows, NSIS v2 series installer script
-;FileDesc Utility functions to set and save/restore file extension to application associations
+#Title AbiWord for Windows, NSIS v2 series installer script
+#FileDesc Utility functions to set and save/restore file extension to application associations
!ifndef _ABI_UTIL_FILEASSOC_NSH_
!ifdef HAVE_SYSTEM_PLUGIN
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; RefreshShellIcons based on
-;; http://nsis.sourceforge.net/archive/nsisweb.php?page=236&instances=0
-;; by jerome tremblay - april 2003
+#;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+#; RefreshShellIcons based on
+#; http://nsis.sourceforge.net/archive/nsisweb.php?page=236&instances=0
+#; by jerome tremblay - april 2003
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
!endif ; HAVE_SYSTEM_PLUGIN
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; parts from http://nsis.sourceforge.net/archive/viewpage.php?pageid=282 by Vytautas
-;; Will add the registry entries to associate the given file extension with the
-;; previously set (see CreateApplicationAssociation) appType. I.e. indicate to
-;; open documents with this extension using the application specified by appType
-;; registry entry. If the extension is currently associated with a different
-;; appType, it will store the current association in the "prior_appType" key.
+#;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+#; parts from http://nsis.sourceforge.net/archive/viewpage.php?pageid=282 by Vytautas
+#; Will add the registry entries to associate the given file extension with the
+#; previously set (see CreateApplicationAssociation) appType. I.e. indicate to
+#; open documents with this extension using the application specified by appType
+#; registry entry. If the extension is currently associated with a different
+#; appType, it will store the current association in the "prior_appType" key.
!macro CreateFileAssociation extension appType contentType
!define skipBackupLbl "skipBackup_${__LINE__}"
push $0
- ; back up old value of extension (.ext) if it exists
+ # back up old value of extension (.ext) if it exists
ReadRegStr $0 HKCR "${extension}" "" ; read current value
StrCmp $0 "" "${skipBackupLbl}" ; nothing, then skip storing old value
StrCmp $0 "${appType}" "${skipBackupLbl}" ; only store if old is different than current
WriteRegStr HKCR "${extension}" "prior_value" "$0" ; actually store the old association
"${skipBackupLbl}:"
- ; Write File Associations
+ # Write File Associations
WriteRegStr HKCR "${extension}" "" "${appType}"
WriteRegStr HKCR "${extension}" "Content Type" "${contentType}"
- ; Force shell refresh (so icons updated as needed)
+ # Force shell refresh (so icons updated as needed)
${RefreshShellIcons}
pop $0
WriteRegStr HKCR "${appType}\shell" "" "open"
WriteRegStr HKCR "${appType}\DefaultIcon" "" "${defIcon}"
- ; Basic command to open the file (pass filename as argv[1] to program executable)
+ # Basic command to open the file (pass filename as argv[1] to program executable)
WriteRegStr HKCR "${appType}\shell\open\command" "" '"${exeCmd}" "%1"'
- ; To open file via DDE (OLE, ie via already active instance) instead of in a new process
- ; Here for those who want to locally enable, not normally used as having each document
- ; open in a new process while more resource intensive means a crash with one document
- ; won't cause loss of work with other open documents.
-; WriteRegStr HKCR "${appType}\shell\open\command" "" "${exeCmd}"
-; WriteRegStr HKCR "${appType}\shell\open\ddeexec" "" '[Open("%1")]'
-; WriteRegStr HKCR "${appType}\shell\open\ddeexec\application" "" "${appName}"
-; WriteRegStr HKCR "${appType}\shell\open\ddeexec\topic" "" "System"
+ # To open file via DDE (OLE, ie via already active instance) instead of in a new process
+ # Here for those who want to locally enable, not normally used as having each document
+ # open in a new process while more resource intensive means a crash with one document
+ # won't cause loss of work with other open documents.
+# WriteRegStr HKCR "${appType}\shell\open\command" "" "${exeCmd}"
+# WriteRegStr HKCR "${appType}\shell\open\ddeexec" "" '[Open("%1")]'
+# WriteRegStr HKCR "${appType}\shell\open\ddeexec\application" "" "${appName}"
+# WriteRegStr HKCR "${appType}\shell\open\ddeexec\topic" "" "System"
- ; If editing file is a different action than simply opening file
-; WriteRegStr HKCR "${appType}\shell\edit" "" "Edit Options File"
-; WriteRegStr HKCR "${appType}\shell\edit\command" "" '"${exeCmd}" "%1"'
+ # If editing file is a different action than simply opening file
+# WriteRegStr HKCR "${appType}\shell\edit" "" "Edit Options File"
+# WriteRegStr HKCR "${appType}\shell\edit\command" "" '"${exeCmd}" "%1"'
!macroend
!define CreateApplicationAssociation "!insertmacro CreateApplicationAssociation"
-; check if a file extension is associated with us and if so delete it
+# check if a file extension is associated with us and if so delete it
!macro RemoveFileAssociation extension appType
push $0
push $1
-;NSIS Modern User Interface - Language File
-;Compatible with Modern UI 1.68
+#NSIS Modern User Interface - Language File
+#Compatible with Modern UI 1.68
-;Language: Galician (1110)
-;Ramon Flores <fa2ramon@usc.es>
+#Language: Galician (1110)
+#Ramon Flores <fa2ramon@usc.es>
-;--------------------------------
+#--------------------------------
!insertmacro MUI_LANGUAGEFILE_BEGIN "Galician"
!define SHORTCUT '${APP_NAME} ${APP_SERIES_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}"'
-;--------------------------------
-;Sections
+#--------------------------------
+#Sections
Section -FileAssociations
- ;Associate .lyx files with LyX for current user of all users
+ #Associate .lyx files with LyX for current user of all users
- ;Write information about file type
+ #Write information about file type
!define REG_FILETYPE 'WriteRegStr SHELL_CONTEXT "Software\Classes\${APP_REGNAME_DOC}'
${REG_FILETYPE}" "" "${APP_NAME} Document"
${REG_FILEEXT} "" "${APP_REGNAME_DOC}"
${REG_FILEEXT} "Content Type" "${APP_MIME_TYPE}"
- ;Refresh shell
+ #Refresh shell
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
SectionEnd
Section -InstallData
- ;Registry information
+ #Registry information
WriteRegStr SHELL_CONTEXT ${APP_REGKEY} "" $INSTDIR
WriteRegStr SHELL_CONTEXT ${APP_REGKEY} "Version" "${APP_VERSION}"
WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETUP} "Ghostscript Path" $PathGhostscript
WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETUP} "LyX Language" $LangName
- ;Start Menu shortcut
- ;There is only one shortcut to the application, so it should be in the main group
+ #Start Menu shortcut
+ #There is only one shortcut to the application, so it should be in the main group
CreateShortCut "$SMPROGRAMS\${SHORTCUT}
- ;Uninstaller information
+ #Uninstaller information
!define REG_UNINSTALL 'WriteRegStr SHELL_CONTEXT "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SETUP_UNINSTALLER_KEY}"'
${if} $CurrentUserInstall == ${TRUE}
Section -LaTeX
- ;Let MiKTeX ask the user again to download packages if needed
+ #Let MiKTeX ask the user again to download packages if needed
- ;MiKTeX 2.5
+ #MiKTeX 2.5
ReadRegStr $R0 HKCU "Software\MiKTeX.org\MiKTeX\2.5\MPM" "AutoInstall"
WriteRegStr HKCU "Software\MiKTeX.org\MiKTeX\2.5\MPM" "AutoInstall" 2
${endif}
- ;MiKTeX 2.4
+ #MiKTeX 2.4
ReadRegStr $R0 HKCU "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "InstallPackagesOnTheFly"
WriteRegStr HKCU "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "InstallPackagesOnTheFly" 2
${endif}
- ;dvipost package
+ #dvipost package
Call SearchLaTeXLocalRoot
Pop $R0
File "${FILES_DVIPOST_PKG}\dvipost.sty"
${endif}
- ;Update file name database
+ #Update file name database
${if} $PathLaTeX != ""
nsExec::Exec '"$PathLaTeX\initexmf.exe" --update-fndb'
Section -Configure
- ;Windows specific configuration in lyxrc.dist
+ #Windows specific configuration in lyxrc.dist
Delete "$INSTDIR\Resources\lyxrc.dist"
FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
- ;Path prefix
+ #Path prefix
Call GetPathPrefix
Pop $R0
FileWrite $R1 '\path_prefix "$R0"$\r$\n'
- ;Default screen fonts
+ #Default screen fonts
FileWrite $R1 '\screen_font_roman "Times New Roman"$\r$\n'
FileWrite $R1 '\screen_font_sans "Arial"$\r$\n'
FileWrite $R1 '\screen_font_typewriter "Courier New"$\r$\n'
FileWrite $R1 '\preview_scale_factor 1.0$\r$\n' ;Fit instant preview font size to screen fonts
- ;PDF view helper
+ #PDF view helper
FileWrite $R1 '\format "pdf" "pdf" "PDF (ps2pdf)" "P" "pdfview" "" "document,vector"$\r$\n'
FileWrite $R1 '\format "pdf2" "pdf" "PDF (pdflatex)" "F" "pdfview" "" "document,vector"$\r$\n'
FileWrite $R1 '\format "pdf3" "pdf" "PDF (dvipdfm)" "m" "pdfview" "" "document,vector"$\r$\n'
FileClose $R1
- ;Information in the registry for the launcher
+ #Information in the registry for the launcher
- ;Set language
+ #Set language
WriteRegStr SHELL_CONTEXT ${APP_REGKEY_SETTINGS} "Language" $LangISOCode
SectionEnd
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function CheckDesktopShortcut
- ;Enable desktop icon creation when there is an icon already
- ;Old shortcuts need to be updated
+ #Enable desktop icon creation when there is an icon already
+ #Old shortcuts need to be updated
${if} ${fileexists} "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "State" "1"
Function CreateDesktopShortcut
- ;Creating a desktop shortcut is an option on the finish page
+ #Creating a desktop shortcut is an option on the finish page
CreateShortCut "$DESKTOP\${SHORTCUT}
*/
-;--------------------------------
-;Sections
+#--------------------------------
+#Sections
Section -Core SecCore
- ;Install and register the core LyX files
+ #Install and register the core LyX files
InitPluginsDir
- ;Binaries
+ #Binaries
SetOutPath "$INSTDIR\bin"
!insertmacro FileListPDFViewBin File "${FILES_PDFVIEW}\"
!insertmacro FileListPDFToolsBin File "${FILES_PDFTOOLS}\"
- ;Icons
+ #Icons
SetOutPath "$INSTDIR\bin"
!insertmacro FileListLyXIcons File "${FILES_ICONS}\"
- ;Resources
+ #Resources
SetOutPath "$INSTDIR"
File /r "${FILES_LYX}\Resources"
SetOutPath "$INSTDIR\Resources\fonts"
!insertmacro FileListFonts File "${FILES_FONTS}\"
- ;Components of Python
+ #Components of Python
SetOutPath "$INSTDIR\python"
!insertmacro FileListPythonBin File "${FILES_PYTHON}\"
SetOutPath "$INSTDIR\python\Lib\encodings"
!insertmacro FileListPythonLibEncodings File "${FILES_PYTHON}\Lib\encodings\"
- ;Aspell
+ #Aspell
File /oname=$PLUGINSDIR\AspellData.exe "${FILES_ASPELLDATA}\AspellData.exe"
Delete "$PLUGINSDIR\AspellData.exe"
- ;Aiksarus data
+ #Aiksarus data
SetOutPath "$INSTDIR\aiksaurus"
!insertmacro FileListAiksaurusData File "${FILES_AIKSAURUS}\"
- ;Helper DLLs for NSIS-based tools
+ #Helper DLLs for NSIS-based tools
SetOutPath "$INSTDIR\bin"
!insertmacro FileListNSISPluginsStandard File "${NSISDIR}\Plugins\"
!insertmacro FileListNSISPlugins File "${FILES_NSISPLUGINS}\"
- ;Create uninstaller
+ #Create uninstaller
WriteUninstaller "$INSTDIR\${SETUP_UNINSTALLER}"
SectionEnd
*/
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro Dictionary FILE LANGNAME LANGCODE SIZE
!macroend
-;--------------------------------
-;Sections
+#--------------------------------
+#Sections
Section -AspellDicts
${DICT} uk-1.1-0 "Ukrainian" uk 582
${DICT} cy-0.50-3 "Welsh" cy 1770
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function GetAspellHive
- ;Check whether the system or local version of Aspell should be used
- ;The patched Aspell uses the same logic
+ #Check whether the system or local version of Aspell should be used
+ #The patched Aspell uses the same logic
Push $R0
dict_download:
- ;Download
+ #Download
InetLoad::load "${DOWNLOAD_ASPELLDICTS}/aspell6-$R0.exe" "$PLUGINSDIR\aspell6-$R0.exe" /END
Pop $R3
${if} $R3 != "OK"
- ;Download failed
+ #Download failed
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_DOWNLOAD_FAILED_DICT) ($R3)" IDYES dict_download
Goto dict_noinstall
${endif}
*/
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro SetComponentState VAR COMPONENT
StrCpy $R1 $Size${COMPONENT}
${if} $Path${COMPONENT} == ""
- ;Add size of component itself
+ #Add size of component itself
IntOp $R1 $R1 + ${SIZE_${COMPONENT}}
${endif}
!macro ExternalComponent COMPONENT
- ;Action depending on type of installer
+ #Action depending on type of installer
${if} $Setup${component} == ${TRUE}
!macro SetupComponent COMPONENT
- ;Run the setup application for a component
+ #Run the setup application for a component
install_${COMPONENT}:
download_${COMPONENT}:
- ;Download using HTTP
+ #Download using HTTP
InetLoad::load "${DOWNLOAD_${COMPONENT}}" "$PLUGINSDIR\${COMPONENT}Setup.exe" /END
Pop $R0
${if} $R0 != "OK"
- ;Download failed
+ #Download failed
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_DOWNLOAD_FAILED_${COMPONENT}) ($R0)" IDYES download_${COMPONENT}
Goto noinstall_${COMPONENT}
${endif}
!macro InstallComponent COMPONENT
- ;Extract
+ #Extract
File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${FILES_BUNDLE}\${INSTALL_${COMPONENT}}
!insertmacro SetupComponent ${COMPONENT}
!macro DialogExternalControl component
- ;Enable/disable the DirRequest control
+ #Enable/disable the DirRequest control
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "external_${component}.ini" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "external_${component}.ini" "Field 4" "HWND"
EnableWindow $R1 $R0
Push $R0
Push $R1
- ;Next button pressed?
+ #Next button pressed?
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "external_${COMPONENT}.ini" "Settings" "State"
${if} $R0 != "0"
!insertmacro DialogExternalControl ${COMPONENT}
Abort
${endif}
- ;Download?
+ #Download?
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "external_${COMPONENT}.ini" "Field 2" "State"
!insertmacro SetComponentState $R0 ${COMPONENT}
- ;Folder?
+ #Folder?
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "external_${COMPONENT}.ini" "Field 3" "State"
${if} $R0 == "1"
!macroend
-;--------------------------------
-;Sections
+#--------------------------------
+#Sections
Section -LaTeX ExternalLaTeX
!insertmacro ExternalComponent LaTeX
!insertmacro ExternalComponent Ghostscript
SectionEnd
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function InitSizeExternal
- ;Get sizes of external component installers
+ #Get sizes of external component installers
SectionGetSize ${ExternalLaTeX} $SizeLaTeX
SectionGetSize ${ExternalImageMagick} $SizeImageMagick
SectionGetSize ${ExternalGhostscript} $SizeGhostscript
!ifndef SETUPTYPE_BUNDLE
- ;Add download size
+ #Add download size
IntOp $SizeLaTeX $SizeLaTeX + ${SIZE_DOWNLOAD_LATEX}
IntOp $SizeImagemagick $SizeImagemagick + ${SIZE_DOWNLOAD_IMAGEMAGICK}
IntOp $SizeGhostscript $SizeGhostscript + ${SIZE_DOWNLOAD_GHOSTSCRIPT}
FunctionEnd
-;--------------------------------
-;Page functions
+#--------------------------------
+#Page functions
Function PageExternalLaTeX
!insertmacro DialogExternalShow LaTeX
*/
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro SetSystemLangItem VAR LANGNAME LANGISOCODE LANGID
!macro GetISOLangCode VAR_LANGNAME VAR_LANGISOCODE
- ;Get the language code for the selected language name
+ #Get the language code for the selected language name
!insertmacro LanguageList '!insertmacro GetISOLangCodeItem ${VAR_LANGNAME} ${VAR_LANGISOCODE}'
!macroend
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function InitLanguage
- ;Set the default for the language selection dialog to the Windows language
+ #Set the default for the language selection dialog to the Windows language
System::Call "kernel32::GetUserDefaultUILanguage()i.R0"
!insertmacro SetSystemLang $R0
FunctionEnd
-;--------------------------------
-;Page functions
+#--------------------------------
+#Page functions
Function PageLanguage
*/
-;--------------------------------
-;Page functions
+#--------------------------------
+#Page functions
Function PageReinstall
- ;Check whether this version is already installed
+ #Check whether this version is already installed
ReadRegStr $R0 SHELL_CONTEXT ${APP_REGKEY} "Version"
*/
-;--------------------------------
-;Sections
+#--------------------------------
+#Sections
Section "un.Program Files" un.SecProgramFiles
- ;Binaries
+ #Binaries
Delete "$INSTDIR\bin\lyx.exe"
Delete "$INSTDIR\bin\lyxc.exe"
!insertmacro FileListPDFToolsBin Delete "$INSTDIR\bin\"
!insertmacro FileListPDFViewBin Delete "$INSTDIR\bin\"
- ;Icons
+ #Icons
!insertmacro FileListLyXIcons Delete "$INSTDIR\bin\"
- ;Resources
+ #Resources
RMDir /r "$INSTDIR\Resources"
- ;Components of Python
+ #Components of Python
RMDir /r "$INSTDIR\python"
- ;Aiksaurus Data
+ #Aiksaurus Data
!insertmacro FileListAiksaurusData Delete "$INSTDIR\aiksaurus\"
RMDir "$INSTDIR\aiksaurus"
- ;Helper DLLs for NSIS-based tools
+ #Helper DLLs for NSIS-based tools
!insertmacro FileListNSISPluginsStandard Delete "$INSTDIR\bin\"
!insertmacro FileListNSISPlugins Delete "$INSTDIR\bin\"
- ;Shortcuts
+ #Shortcuts
Delete "$SMPROGRAMS\${APP_NAME} ${APP_SERIES_NAME}.lnk"
Delete "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
- ;Uninstaller itself
+ #Uninstaller itself
Delete "$INSTDIR\${SETUP_UNINSTALLER}"
RMDir "$INSTDIR\bin"
- ;Application folder
+ #Application folder
SetOutPath "$PROGRAMFILES"
RMDir "$INSTDIR"
- ;Registry keys
+ #Registry keys
DeleteRegKey SHELL_CONTEXT "${APP_REGKEY_SETUP}"
DeleteRegKey SHELL_CONTEXT "${APP_REGKEY}"
DeleteRegKey SHELL_CONTEXT "Software\Classes\${APP_REGNAME_DOC}"
DeleteRegKey SHELL_CONTEXT "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SETUP_UNINSTALLER_KEY}"
- ;File associations
+ #File associations
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
*/
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro GetDirExternal COMPONENT
!macroend
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function InitUser
- ;Get directories from registry
+ #Get directories from registry
ReadRegStr $R0 SHELL_CONTEXT "${APP_REGKEY}" ""
!insertmacro GetDirExternal ImageMagick
!insertmacro GetDirExternal Ghostscript
- ;Set directories in dialogs
+ #Set directories in dialogs
!insertmacro InitDialogExternalDir latex ${TRUE}
!insertmacro InitDialogExternalDir imagemagick ${FALSE}
!insertmacro InitDialogExternalDir ghostscript ${FALSE}
- ;Get LyX language
+ #Get LyX language
ReadRegStr $R0 SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
FunctionEnd
-;--------------------------------
-;Page functions
+#--------------------------------
+#Page functions
Function PageUser
- ;Only show page if installing for all users is possible
+ #Only show page if installing for all users is possible
${if} $AdminOrPowerUser == ${FALSE}
Call InitUser
Abort
*/
-;--------------------------------
-;Sections
+#--------------------------------
+#Sections
Section -Viewer ExternalViewer
!insertmacro ExternalComponent Viewer
SectionEnd
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function InitSizeViewer
- ;Get size of viewer installer
+ #Get size of viewer installer
SectionGetSize ${ExternalViewer} $SizeViewer
!ifndef SETUPTYPE_BUNDLE
- ;Add download size
+ #Add download size
IntOp $SizeViewer $SizeViewer + ${SIZE_DOWNLOAD_VIEWER}
!endif
FunctionEnd
-;--------------------------------
-;Page functions
+#--------------------------------
+#Page functions
Function PageViewer
- ;Show page if no viewer is installed, the user has Power User or Administrator priviledges and
- ;Ghostscript is installed or will be installed
+ #Show page if no viewer is installed, the user has Power User or Administrator priviledges and
+ #Ghostscript is installed or will be installed
${if} $AdminOrPowerUser == ${FALSE}
${orif} $PathViewer == "associated"
Function PageViewerValidate
- ;Download?
+ #Download?
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "viewer.ini" "Field 2" "State"
!insertmacro SetComponentState $R0 Viewer
!include "settings.user.nsh"
!include "settings.nsh"
-;--------------------------------
-;Defines based on settings
+#--------------------------------
+#Defines based on settings
!ifndef SETUPTYPE_BUNDLE
!define SETUPTYPE_NAME DOWNLOAD
!define SETUPTYPE_NAME INSTALL
!endif
-;--------------------------------
-;Standard header files
+#--------------------------------
+#Standard header files
!include "MUI.nsh"
!include "LogicLib.nsh"
!include "Sections.nsh"
!include "WinVer.nsh"
-;--------------------------------
-;Windows constants
+#--------------------------------
+#Windows constants
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0x0000
-;--------------------------------
-;Reserve Files
-;These files should come first in the compressed data (for faster GUI)
+#--------------------------------
+#Reserve Files
+#These files should come first in the compressed data (for faster GUI)
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
ReserveFile "dialogs\user.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
ReserveFile "${FILES_DVIPOST_PKG}\dvipost.sty"
-;--------------------------------
-;Variables
+#--------------------------------
+#Variables
Var AdminOrPowerUser
Var CurrentUserInstall
Var AspellHive
-;--------------------------------
-;Include standard functions
+#--------------------------------
+#Include standard functions
!insertmacro FUNCTION_STRING_StrStr
!insertmacro VersionCompare
!insertmacro WordFind2X
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro ReDef NAME VALUE
- ;Redefine a pre-processor definition
+ #Redefine a pre-processor definition
!ifdef `${NAME}`
!undef `${NAME}`
!macro CallFunc FUNCTION INPUT VAROUT
- ;Calls a function that modifies a single value on the stack
+ #Calls a function that modifies a single value on the stack
Push ${INPUT}
Call ${FUNCTION}
!macroend
-;--------------------------------
-;LyX installer header files
+#--------------------------------
+#LyX installer header files
!include "include\init.nsh"
!include "include\windows.nsh"
*/
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro SearchMiKTeX25
- ;Detect location of MiKTeX installation using initexmf
+ #Detect location of MiKTeX installation using initexmf
Push $R0
StrCpy $R1 0
"${Index}-Loop:"
- ;Check for key
+ #Check for key
EnumRegKey $R0 ${ROOT} "${MAIN_KEY}" "$R1"
StrCmp $R0 "" "${Index}-False"
IntOp $R1 $R1 + 1
StrCmp $R0 "${KEY}" "${Index}-True" "${Index}-Loop"
"${Index}-True:"
- ;Found
+ #Found
Push ${TRUE}
Goto "${Index}-End"
"${Index}-False:"
- ;Not found
+ #Not found
Push ${FALSE}
goto "${Index}-End"
!macroend
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function SearchAll
Function TrimBackslash
- ;Trim a trailing backslash of a directory
+ #Trim a trailing backslash of a directory
Exch $R0
Push $R1
Function DetectViewerByExtension
- ;Input on stack: file extension without dot
+ #Input on stack: file extension without dot
Exch $R0
Push $R1
Function SearchLaTeX
- ;Search where MikTeX is installed
+ #Search where MikTeX is installed
!insertmacro SearchMiKTeX25
Function SearchLaTeXLocalRoot
- ;Search for the MikTeX local root
- ;Returns value on stack
+ #Search for the MikTeX local root
+ #Returns value on stack
Push $R0
- ;MikTeX 2.5
+ #MikTeX 2.5
!insertmacro IfKeyExists HKCU "Software\MiKTeX.org\MiKTeX" "2.5"
Pop $R0
StrCpy $R0 "$APPDATA\MiKTeX\2.5"
${else}
- ;MiKTeX 2.4
+ #MiKTeX 2.4
ReadRegStr $R0 HKCU "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Local Root"
Function SearchGhostscript
- ;Search where Ghostscript is installed
+ #Search where Ghostscript is installed
Push $R0 ;Temp
Push $R1 ;Counter
StrCpy $R3 ""
StrCpy $R4 ""
- ;Check the latest version of AFPL Ghostscript installed
+ #Check the latest version of AFPL Ghostscript installed
StrCpy $R1 0
${loopuntil} $R2 == ""
- ;The same for GPL Ghostscript
+ #The same for GPL Ghostscript
StrCpy $R1 0
${loopuntil} $R2 == ""
- ;Take the latest one
+ #Take the latest one
${VersionCompare} $R3 $R4 $R0
${if} $R0 == "1"
- ;AFPL is newer
+ #AFPL is newer
ReadRegStr $PathGhostscript HKLM "Software\AFPL Ghostscript\$R3" "GS_DLL"
${else}
- ;GPL is newer or equal
+ #GPL is newer or equal
ReadRegStr $PathGhostscript HKLM "Software\GPL Ghostscript\$R4" "GS_DLL"
${endif}
- ;Trim the DLL filename to get the path
+ #Trim the DLL filename to get the path
${GetParent} $PathGhostscript $PathGhostscript
${unless} ${FileExists} "$PathGhostscript\${BIN_GHOSTSCRIPT}"
Function SearchImageMagick
- ;Search where ImageMagick is installed
+ #Search where ImageMagick is installed
ReadRegStr $PathImageMagick HKLM "Software\ImageMagick\Current" "BinPath"
${unless} ${FileExists} "$PathImageMagick\${BIN_IMAGEMAGICK}"
*/
-;--------------------------------
-;General
+#--------------------------------
+#General
Name "${APP_NAME} ${APP_VERSION}"
BrandingText " "
-;Default installation folder
+#Default installation folder
InstallDir "${SETUP_DEFAULT_DIRECTORY}"
-;--------------------------------
-;Interface settings
+#--------------------------------
+#Interface settings
!define MUI_ABORTWARNING
!define MUI_ICON "${SETUP_ICON}"
!define MUI_CUSTOMFUNCTION_GUIINIT InitInterface
!define MUI_COMPONENTSPAGE_NODESC
-;--------------------------------
-;Pages
+#--------------------------------
+#Pages
-;Installer
+#Installer
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT $(TEXT_WELCOME_${SETUPTYPE_NAME})
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckDesktopShortcut
!insertmacro MUI_PAGE_FINISH
-;Uninstaller
+#Uninstaller
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT $(UNTEXT_WELCOME)
!insertmacro MUI_UNPAGE_FINISH
-;--------------------------------
-;Installer Languages
+#--------------------------------
+#Installer Languages
!insertmacro IncludeLang "english"
!insertmacro IncludeLang "french"
!insertmacro IncludeLang "german"
!insertmacro IncludeLang "italian"
-;--------------------------------
-;Version information
+#--------------------------------
+#Version information
VIProductVersion "${APP_VERSION_NUMBER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APP_COPYRIGHT}"
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro InitDialogExternal COMPONENT CURRENTUSER_POSSIBLE
!macroend
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function InitDialogs
Push $R0
- ;Extract dialogs
+ #Extract dialogs
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "dialogs\user.ini" "user.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "dialogs\reinstall.ini" "reinstall.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "dialogs\viewer.ini" "viewer.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "dialogs\langselect.ini" "langselect.ini"
- ;Write texts
+ #Write texts
!insertmacro MUI_INSTALLOPTIONS_WRITE "user.ini" "Field 1" "Text" $(TEXT_USER_INFO)
!insertmacro MUI_INSTALLOPTIONS_WRITE "user.ini" "Field 2" "Text" $(TEXT_USER_ALL)
!insertmacro MUI_INSTALLOPTIONS_WRITE "langselect.ini" "Field 2" "ListItems" $R0
!insertmacro MUI_INSTALLOPTIONS_WRITE "langselect.ini" "Field 2" "State" "English" ;Default language
- ;Set state of user dialog
+ #Set state of user dialog
${if} $CurrentUserInstall == ${TRUE}
!insertmacro MUI_INSTALLOPTIONS_WRITE "user.ini" "Field 2" "State" "0"
!insertmacro MUI_INSTALLOPTIONS_WRITE "user.ini" "Field 3" "State" "1"
*/
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function CommandLineParameter
Banner::show /NOUNLOAD "Checking system"
${endif}
- ;Check all dependencies
+ #Check all dependencies
Call CheckWindows
Call CheckPrivileges
Function LoadInstaller
- ;Set the correct shell context depending on command line parameter
- ;and priviledges
+ #Set the correct shell context depending on command line parameter
+ #and priviledges
Push $R0
${else}
- ;Display an error when the /AllUsers command line parameter is used
- ;by a user without Administrator or Power User priviledges
+ #Display an error when the /AllUsers command line parameter is used
+ #by a user without Administrator or Power User priviledges
Push "/AllUsers"
Call CommandLineParameter
Function un.LoadUnInstaller
- ;Set the correct shell context depending on whether LyX has been installed
- ;for the current user or all users
+ #Set the correct shell context depending on whether LyX has been installed
+ #for the current user or all users
ReadRegStr $R0 HKCU ${APP_REGKEY} ""
!macro LanguageList COMMAND
- ;List of supported LyX languages with ISO code and language identifier
- ;To be used as input for other macros
+ #List of supported LyX languages with ISO code and language identifier
+ #To be used as input for other macros
${COMMAND} "Bokmål" nb_NO 1044
${COMMAND} "Ce\9atina" cs_CZ 1029
!macro LanguageStringAdd lang_name name
- ;Takes a define and puts that into a language string
+ #Takes a define and puts that into a language string
LangString "${name}" "${LANG_${lang_name}}" "${${name}}"
!undef "${name}"
!macro LanguageStringCreate lang_name
- ;Creates all language strings
+ #Creates all language strings
!insertmacro ReDef LanguageStringAdd '!insertmacro LanguageStringAdd "${lang_name}"'
${LanguageStringAdd} TEXT_NO_PRIVILEDGES
!define DICT_NAME $R1
!endif
- ;Include both NSIS/LyX language file
+ #Include both NSIS/LyX language file
!insertmacro MUI_LANGUAGE "${langname}"
*/
-;--------------------------------
-;Macros
+#--------------------------------
+#Macros
!macro CheckPrivileges
!macroend
-;--------------------------------
-;Functions
+#--------------------------------
+#Functions
Function CheckPrivileges
!insertmacro CheckPrivileges
Function CheckWindows
- ;Check for Windows NT 5.0 or later (2000, XP, 2003 etc.)
+ #Check for Windows NT 5.0 or later (2000, XP, 2003 etc.)
${unless} ${IsNT}
${andunless} ${AtLeastWin2000}
Push $R0
Push $R1
- ;Updates the path environment variable of the instaler process to the latest system value
+ #Updates the path environment variable of the instaler process to the latest system value
ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path
ReadRegStr $R1 HKCU "Environment" Path
\r
!include "include\declarations.nsh"\r
\r
-;--------------------------------\r
-;Compile the launcher\r
+#--------------------------------\r
+#Compile the launcher\r
\r
!system '"${NSISDIR}\makensis.exe" "${FILES_LAUNCHER}\launcher.nsi"'\r
\r
-;--------------------------------\r
-;Compile Windows PDF view helper\r
+#--------------------------------\r
+#Compile Windows PDF view helper\r
\r
!system '"${NSISDIR}\makensis.exe" "${FILES_PDFVIEW}\pdfview.nsi"'\r
\r
-;--------------------------------\r
-;LyX Installer, output file can be specified using command line option\r
-; /DExeFile=/path/to/installer\r
+#--------------------------------\r
+#LyX Installer, output file can be specified using command line option\r
+# /DExeFile=/path/to/installer\r
\r
!ifdef ExeFile\r
!ifdef SETUPTYPE_BUNDLE\r
Outfile "${SETUP_EXE}"\r
!endif\r
\r
-;--------------------------------\r
-;Components\r
+#--------------------------------\r
+#Components\r
\r
!include "components\core.nsh"\r
!include "components\user.nsh"\r
\r
*/\r
\r
-;--------------------------------\r
-;File locations\r
+#--------------------------------\r
+#File locations\r
\r
!define FILES_LICENSE "license.rtf"\r
\r
\r
!define FILES_NSISPLUGINS "${FILES_DEPS}\nsis"\r
\r
-;--------------------------------\r
-;Locations of components to download\r
+#--------------------------------\r
+#Locations of components to download\r
!define DOWNLOAD_LATEX "http://superb-west.dl.sourceforge.net/sourceforge/miktex/basic-miktex-2.5.2580.exe"\r
!define DOWNLOAD_IMAGEMAGICK "http://superb-west.dl.sourceforge.net/sourceforge/imagemagick/ImageMagick-6.3.2-5-Q16-windows-dll.exe"\r
!define DOWNLOAD_GHOSTSCRIPT "http://superb-west.dl.sourceforge.net/sourceforge/ghostscript/gs854w32-gpl.exe"\r
\r
!define DOWNLOAD_ASPELLDICTS "ftp://ftp.lyx.org/pub/lyx/contrib/aspell6-windows"\r
\r
-;--------------------------------\r
-;Download size (in KB)\r
+#--------------------------------\r
+#Download size (in KB)\r
\r
!define SIZE_DOWNLOAD_LATEX 47271\r
!define SIZE_DOWNLOAD_IMAGEMAGICK 7096\r
!define SIZE_DOWNLOAD_GHOSTSCRIPT 12669\r
!define SIZE_DOWNLOAD_VIEWER 1459\r
\r
-;--------------------------------\r
-;Approximations of space required for components (in KB)\r
+#--------------------------------\r
+#Approximations of space required for components (in KB)\r
\r
!define SIZE_LATEX 120000\r
!define SIZE_IMAGEMAGICK 17000\r
!define SIZE_GHOSTSCRIPT 26000\r
!define SIZE_VIEWER 4000\r
\r
-;--------------------------------\r
-;Locations of setup files for components (for bundled setup)\r
+#--------------------------------\r
+#Locations of setup files for components (for bundled setup)\r
\r
!define INSTALL_LATEX "basic-miktex-2.5.2580.exe"\r
!define INSTALL_IMAGEMAGICK "ImageMagick-6.3.2-5-Q16-windows-dll.exe"\r
!define INSTALL_GHOSTSCRIPT "gs854w32-gpl.exe"\r
!define INSTALL_VIEWER "gsv48w32.exe"\r
\r
-;--------------------------------\r
-;Names and version\r
+#--------------------------------\r
+#Names and version\r
\r
!define APP_NAME "LyX"\r
!define /date APP_VERSION "1.5svn %Y%m%d"\r
!define APP_EXT ".lyx"\r
!define APP_MIME_TYPE "application/lyx"\r
\r
-;--------------------------------\r
-;Setup settings\r
+#--------------------------------\r
+#Setup settings\r
\r
!ifndef SETUPTYPE_BUNDLE\r
!define /date SETUP_EXE "lyx-15svn-%Y%m%d.exe"\r
!define SETUP_UNINSTALLER "Uninstall-${APP_NAME}.exe"\r
!define SETUP_UNINSTALLER_KEY "${APP_NAME}"\r
\r
-;--------------------------------\r
-;Names of binaries to identify compontents\r
+#--------------------------------\r
+#Names of binaries to identify compontents\r
\r
!define BIN_LATEX "tex.exe"\r
!define BIN_IMAGEMAGICK "convert.exe"\r
!define BIN_GHOSTSCRIPT "gswin32c.exe"\r
\r
-;--------------------------------\r
-;Custom NSIS plug-ins\r
+#--------------------------------\r
+#Custom NSIS plug-ins\r
\r
!addplugindir "${FILES_NSISPLUGINS}"\r
-;LyX Windows Installer\r
-;User Settings, all these macros can be redefined from command line, \r
-;using options like /DFilesLyX="..\..\..\..\lyx-install"\r
+#LyX Windows Installer\r
+#User Settings, all these macros can be redefined from command line, \r
+#using options like /DFilesLyX="..\..\..\..\lyx-install"\r
\r
-;Location of LyX files and dependencies\r
+#Location of LyX files and dependencies\r
\r
!ifdef FilesLyX\r
!define FILES_LYX "${FilesLyX}"\r
!define FILES_BUNDLE "..\..\..\..\lyx-windows-bundle-deps"\r
!endif\r
\r
-;Location of Windows installation\r
+#Location of Windows installation\r
\r
!ifdef FilesWindows\r
!define FILES_WINDOWS "${FilesWindows}"\r
!define FILES_WINDOWS "C:\WINDOWS"\r
!endif\r
\r
-;Location of Python 2.5\r
+#Location of Python 2.5\r
\r
!ifdef FilesPython\r
!define FILES_PYTHON "${FilesPython}"\r