-Version LyX 1.5beta2-21-04-2007
+Version LyX 1.5svn-02-05-2007
+- LyX 1.5svn from 02-05-2007
+
+- fix bug that file associations were set also when the user has chosen
+ to leave them untouched
+- Update installer: new option to choose wheter the file associations
+ should be updated or not
+- Update installer: fix uninstalling
+
+
+Version LyX 1.5beta2-21-04-2007
- LyX 1.5 beta2 from 21-04-2007
- math-macro fixes
- math delimiter changed again
${endif}
; register LyX
+ ${if} $CreateFileAssociations == "true"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
+ ${endif}
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
; The '-' makes the section invisible.
Section "-Installation actions" SecInstallation
+ ; dummy actions to avoid NSIS warnings
+ StrCpy $FileName ""
+ StrCpy $NewString ""
+ StrCpy $OldString ""
+
; extract all files
SetOutPath "$INSTDIR"
File /r "${PRODUCT_SOURCEDIR}\bin"
; install MiKTeX if not already installed
Call MiKTeX
+ ; install Ghostscript if it not installed
Call Ghostscript
+ ; install ImageMagick if it not installed
Call ImageMagick
+ ; install ImageMAspellagick if it not installed
Call Aspell
+ ; install Aiksaurus if it not installed
Call Aiksaurus
+ ; install GSview if it not installed and the user selected it
Call PostScript
+ ; install JabRef if it not installed and the user selected it
Call BibTeX
; install the LaTeX class files that are delivered with LyX
FileWrite $R1 '$LaTeXPath'
FileClose $R1
+ ; prepare variables for uninstaller
+ StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersion}
+ StrCpy $JabRefVersionVar ${JabRefVersion}
+
SectionEnd
; -------------------------------------------
; The '-' makes the section invisible.
Section "-Installation actions" SecInstallation
+ ; dummy actions to avoid NSIS warnings
+ StrCpy $FileName ""
+ StrCpy $NewString ""
+ StrCpy $OldString ""
+
; extract all files
SetOutPath "$INSTDIR"
File /r "${PRODUCT_SOURCEDIR}\bin"
File /r "${PRODUCT_SOURCEDIR}\etc"
File /r "${PRODUCT_SOURCEDIR}\Resources"
+ ; install GhostScript if it not installed
Call Ghostscript
+ ; install ImageMagick if it not installed
Call ImageMagick
+ ; install Aspell if it not installed
Call Aspell
+ ; install Aiksaurus if it not installed
Call Aiksaurus
; install the LaTeX class files that are delivered with LyX
FileWrite $R1 '$LaTeXPath'
FileClose $R1
+ ; prepare variables for uninstaller
+ StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersion}
+ StrCpy $JabRefVersionVar ${JabRefVersion}
+
SectionEnd
; -------------------------------------------
; The '-' makes the section invisible.
Section "-Installation actions" SecInstallation
+ ; dummy actions to avoid NSIS warnings
+ StrCpy $AspellBaseReg ""
+ StrCpy $LangCode ""
+ StrCpy $LangCodeSys ""
+ StrCpy $LangName ""
+ StrCpy $LangNameSys ""
+
; extract modified files
Call UpdateModifiedFiles ; macro from Updated.nsh
; delete old uninstaller
Delete "${PRODUCT_UNINSTALL_EXE}"
-
+
; delete old start menu folder
ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY_OLD}" "StartMenu"
RMDir /r $0
Delete "$DESKTOP\${PRODUCT_VERSION_OLD}.lnk"
; delete old registry entries
+ ${if} $CreateFileAssociations == "true"
+ DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
+ ; remove extension .lyx
+ ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
+ ${endif}
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY_OLD}"
- DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
DeleteRegKey HKCR "Applications\lyx.bat"
- ; remove extension .lyx
- ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
DeleteRegKey HKCR "${PRODUCT_NAME}"
; determine the new name of the install location,
- ; only when the user has used the default path settings of the previous LyX-version
- StrCpy $String $INSTDIR
- StrCpy $Search "${PRODUCT_VERSION_OLD}"
- StrLen $3 $String
- Call StrPoint ; search the $INSTDIR for the phrase in ${PRODUCT_VERSION_OLD} ; function from LyXUtils.nsh
- ${if} $Pointer != "-1" ; if something was found
+ ; Change the old install path to the new one (currently only when the user
+ ; has used the default path settings of the previous LyX-version)
+ Call InstDirChange
- IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\${PRODUCT_VERSION_OLD}"
- StrCpy $String $String "$Pointer" ; $String is now the part before "\${PRODUCT_VERSION_OLD}"
- ; rename the installation folder by copying LyX files
- StrCpy $INSTDIR_NEW "$String\LyX ${PRODUCT_VERSION}"
- CreateDirectory "$INSTDIR_NEW"
- CopyFiles "$INSTDIR\*.*" "$INSTDIR_NEW"
- ; delete the old folder
- RMDir /r $INSTDIR
- StrCpy $INSTDIR $INSTDIR_NEW
-
- ; set new PATH_PREFIX in the file lyxrc.dist
- FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" a
- FileRead $R1 $PathPrefix
- ${WordReplace} $PathPrefix "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $PathPrefix
- FileSeek $R1 0 ; set file pointer to the beginning
- FileWrite $R1 '$PathPrefix' ; overwrite the existing path with the actual one
- FileClose $R1
-
- ; set the new path to the preferences file for all users
- StrCpy $FileName "preferences"
- StrCpy $OldString "${PRODUCT_VERSION_OLD}"
- StrCpy $NewString "LyX ${PRODUCT_VERSION}"
- Call CheckAppPathPreferences ; function from LyXUtils.nsh
-
- ; set the new path to the session file for all users
- StrCpy $FileName "session"
- Call CheckAppPathPreferences ; function from LyXUtils.nsh
-
- ; set new path to ImageMagick
- ReadRegStr $ImageMagickPath SHCTX "SOFTWARE\Classes\Applications" "AutoRun"
- ${if} $ImageMagickPath != ""
- ${WordReplace} $ImageMagickPath "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $ImageMagickPath ; macro from WordFunc.nsh
- WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" "$ImageMagickPath"
- ${endif}
-
- ${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed)
+ ; Refresh registry setings for the uninstaller
+ Call RefreshRegUninst
; register LyX
- WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
+ ${if} $CreateFileAssociations == "true"
+ WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
+ ${endif}
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "LyX ${PRODUCT_VERSION}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "HelpLink" "${PRODUCT_HELP_LINK}"
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 0x00000001
WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 0x00000001
-
+
; create start menu entry
SetOutPath "$INSTDIR\bin"
CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
${endif}
; register the extension .lyx
- ${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
- ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
+ ${if} $CreateFileAssociations == "true"
+ ${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
+ ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
+ ${endif}
; create Uninstaller
WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
Delete "$INSTDIR\Resources\configLyX.bat"
SectionEnd
+
+; -------------------------------------------
+
+Function InstDirChange
+
+ ; determine the new name of the install location,
+ ; Change the old install path to the new one (currently only when the user
+ ; has used the default path settings of the previous LyX-version)
+ StrCpy $String $INSTDIR
+ StrCpy $Search "${PRODUCT_VERSION_OLD}"
+ StrLen $3 $String
+ Call StrPoint ; search the $INSTDIR for the phrase in ${PRODUCT_VERSION_OLD} ; function from LyXUtils.nsh
+ ${if} $Pointer != "-1" ; if something was found
+
+ IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\${PRODUCT_VERSION_OLD}"
+ StrCpy $String $String "$Pointer" ; $String is now the part before "\${PRODUCT_VERSION_OLD}"
+ ; rename the installation folder by copying LyX files
+ StrCpy $INSTDIR_NEW "$String\LyX ${PRODUCT_VERSION}"
+ CreateDirectory "$INSTDIR_NEW"
+ CopyFiles "$INSTDIR\*.*" "$INSTDIR_NEW"
+ ; delete the old folder
+ RMDir /r $INSTDIR
+ StrCpy $INSTDIR $INSTDIR_NEW
+
+ ; set new PATH_PREFIX in the file lyxrc.dist
+ FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" a
+ FileRead $R1 $PathPrefix
+ ${WordReplace} $PathPrefix "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $PathPrefix
+ FileSeek $R1 0 ; set file pointer to the beginning
+ FileWrite $R1 '$PathPrefix' ; overwrite the existing path with the actual one
+ FileClose $R1
+
+ ; set the new path to the preferences file for all users
+ StrCpy $FileName "preferences"
+ StrCpy $OldString "${PRODUCT_VERSION_OLD}"
+ StrCpy $NewString "LyX ${PRODUCT_VERSION}"
+ Call CheckAppPathPreferences ; function from LyXUtils.nsh
+
+ ; set the new path to the session file for all users
+ StrCpy $FileName "session"
+ Call CheckAppPathPreferences ; function from LyXUtils.nsh
+
+ ; set new path to ImageMagick
+ ReadRegStr $ImageMagickPath SHCTX "SOFTWARE\Classes\Applications" "AutoRun"
+ ${if} $ImageMagickPath != ""
+ ${WordReplace} $ImageMagickPath "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $ImageMagickPath ; macro from WordFunc.nsh
+ WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" "$ImageMagickPath"
+ ${endif}
+
+ ${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed)
+
+FunctionEnd
+
+; -------------------------------------------
+
+Function RefreshRegUninst
+
+ ; Refresh registry setings for the uninstaller
+
+ ; Aspell
+ ReadRegStr $0 SHCTX "Software\Aspell" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ WriteRegStr HKLM "SOFTWARE\Aspell" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
+ ${endif}
+
+ ; MiKTeX
+ ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
+ StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersionOld}
+ ${endif}
+
+ ; JabRef
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersionOld}" "OnlyWithLyX"
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersionOld}" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
+ StrCpy $JabRefVersionVar ${JabRefVersionOld}
+ ${endif}
+
+ ; Aiksaurus
+ ReadRegStr $0 SHCTX "Software\Aiksaurus" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT_OLD}"
+ WriteRegStr HKLM "SOFTWARE\Aiksaurus" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
+ ${endif}
+
+ ; ImageMagick
+ ReadRegStr $0 SHCTX "Software\ImageMagick" "OnlyWithLyX"
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT_OLD}"
+ WriteRegStr HKLM "SOFTWARE\ImageMagick" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
+ ${endif}
+
+ ; Ghostscript and GSview
+ ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX"
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT_OLD}"
+ WriteRegStr HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
+ ${endif}
+
+FunctionEnd
; load the settings
!include "Settings.nsh"
-!define GSviewInstall "external\gsv48w32.exe"
-!define JabRefInstall "external\JabRef-2.2-Setup.exe"
-!define JabRefVersion "JabRef 2.2"
-!define MiKTeXDeliveredVersion "MiKTeX 2.5"
-!define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.5.2580.exe"
-!define PRODUCT_VERSION_OLD "none" ; only here to avoid warning message - variable only used in Update installer version
-
;--------------------------------
; variables only used in this installer version
Var GhostscriptPath
Var AiksaurusPath
Var AspellPath
-Var AspellInstallYes
-Var AspellBaseReg
-Var AspellMessage
Var Acrobat
Var PSVPath
Var EditorPath
Var ImageEditorPath
Var BibTeXEditorPath
-Var JabRefInstalled
-Var LangName
-Var LangNameSys
-Var LangCode
-Var LangCodeSys
Var LangEncoding
Var LangSysEncoding
-Var DictCode
Var MissedProg
Var LaTeXName
Var MiKTeXVersion
-Var MiKTeXInstalled
Var MiKTeXUser
Var MiKTeXPath
Var InstallGSview
Var InstallJabRef
+; Variables used by all installer versions
+Var AspellInstallYes
+Var AspellBaseReg
+Var AspellMessage
+Var ImageMagickPath
+Var JabRefInstalled
+Var JabRefVersionVar
+Var LatexPath
+Var MiKTeXInstalled
+Var MiKTeXVersionVar
+Var PythonPath
+Var Answer
+Var AppPre
+Var AppSuff
+Var AppPath
+Var CreateDesktopIcon
Var CreateFileAssociations
+Var DictCode
+Var FileName
+Var LangCode
+Var LangCodeSys
+Var LangName
+Var LangNameSys
+Var NewString
+Var OldString
+Var PathPrefix
+Var Pointer
+Var ProductRootKey
Var RunNumber
+Var StartmenuFolder
+Var String
+Var Search
+Var UserList
+Var UserName
;--------------------------------
; load some NSIS libraries
; load the settings
!include "Settings.nsh"
-!define JabRefVersion "JabRef not included" ; only here to avoid warning message - variable only used in Complete installer version
-!define MiKTeXDeliveredVersion "MiKTeX not included" ; only here to avoid warning message - variable only used in Complete installer version
-!define PRODUCT_VERSION_OLD "none" ; only here to avoid warning message - variable only used in Update installer version
-
;--------------------------------
; variables only used in this installer version
Var GhostscriptPath
Var AiksaurusPath
Var AspellPath
-Var AspellInstallYes
-Var AspellBaseReg
-Var AspellMessage
Var Acrobat
Var PSVPath
Var EditorPath
Var ImageEditorPath
Var BibTeXEditorPath
-Var JabRefInstalled
-Var LangName
-Var LangNameSys
-Var LangCode
-Var LangCodeSys
Var LangEncoding
Var LangSysEncoding
-Var DictCode
Var MissedProg
Var LaTeXName
Var MiKTeXVersion
-Var MiKTeXInstalled
Var MiKTeXUser
-Var CreateFileAssociations
Var State
+; Variables used by all installer versions
+Var AspellInstallYes
+Var AspellBaseReg
+Var AspellMessage
+Var ImageMagickPath
+Var JabRefInstalled
+Var JabRefVersionVar
+Var LatexPath
+Var MiKTeXInstalled
+Var MiKTeXVersionVar
+Var PythonPath
+Var Answer
+Var AppPre
+Var AppSuff
+Var AppPath
+Var CreateDesktopIcon
+Var CreateFileAssociations
+Var DictCode
+Var FileName
+Var LangCode
+Var LangCodeSys
+Var LangName
+Var LangNameSys
+Var NewString
+Var OldString
+Var PathPrefix
+Var Pointer
+Var ProductRootKey
Var RunNumber
+Var StartmenuFolder
+Var String
+Var Search
+Var UserList
+Var UserName
;--------------------------------
; load some NSIS libraries
; load the settings
!include "Settings.nsh"
-!define PRODUCT_UNINST_KEY_OLD "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX150svn"
-!define PRODUCT_VERSION_OLD "LyX 1.5beta2-21-04-2007"
-!define PRODUCT_UNINSTALL_EXE_OLD "$INSTDIR\LyXWinUninstall.exe"
-
;--------------------------------
; variables only used in this installer version
Var INSTDIR_NEW
+; Variables used by all installer versions
+Var AspellInstallYes
+Var AspellBaseReg
+Var AspellMessage
+Var ImageMagickPath
+Var JabRefInstalled
+Var JabRefVersionVar
+Var LatexPath
+Var MiKTeXInstalled
+Var MiKTeXVersionVar
+Var PythonPath
+Var Answer
+Var AppPre
+Var AppSuff
+Var AppPath
+Var CreateDesktopIcon
+Var CreateFileAssociations
+Var DictCode
+Var FileName
+Var LangCode
+Var LangCodeSys
+Var LangName
+Var LangNameSys
+Var NewString
+Var OldString
+Var PathPrefix
+Var Pointer
+Var ProductRootKey
+Var RunNumber
+Var StartmenuFolder
+Var String
+Var Search
+Var UserList
+Var UserName
;--------------------------------
; load some NSIS libraries
; list with deleted files
!include "Deleted.nsh"
+; Function for page to install Aspell dictionaries
+!include "Aspell.nsh"
+
;--------------------------------
; Remember the installer language
Section "!${PRODUCT_NAME}" SecCore
SectionIn RO
SectionEnd
+Section "$(SecFileAssocTitle)" SecFileAssoc
+ StrCpy $CreateFileAssociations "true"
+SectionEnd
Section "$(SecDesktopTitle)" SecDesktop
StrCpy $CreateDesktopIcon "true"
SectionEnd
;--------------------------------
; The Uninstaller
-Function un.onInit
-
- ; Check that LyX is not currently running
- FindProcDLL::FindProc "lyx.exe"
- ${if} $R0 == "1"
- MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
- Abort
- ${endif}
-
- ; set registry root key
- StrCpy $Answer ""
- !insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
- ${if} $Answer == "yes"
- SetShellVarContext all
- ${else}
- SetShellVarContext current
- ${endif}
-
- ; Ascertain whether the user has sufficient privileges to uninstall.
- ; abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
- ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
- ${if} $0 != ""
- ${andif} $Answer != "yes"
- MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
- Abort
- ${endif}
- ; abort when LyX couldn't be found in the registry
- ${if} $0 == "" ; check in HKCU
- ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
- ${if} $0 == ""
- MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
- ${endif}
- ${endif}
-
-FunctionEnd
-
-Function un.onUninstSuccess
-
- HideWindow ; hides the uninstaller Window when it is ready
-
-FunctionEnd
-
-Section "un.LyX" un.SecUnProgramFiles
-
- SectionIn RO
-
- ; delete LaTeX class files that were installed together with LyX
- FileOpen $R5 "$INSTDIR\Resources\uninstallPaths.dat" r
- FileRead $R5 $LatexPath
- FileClose $R5
- StrCpy $String $LatexPath
- StrCpy $Search "miktex\bin"
- StrLen $3 $String
- Call un.StrPoint ; search the LaTeXPath for the phrase "miktex\bin" (function from LyXUtils.nsh)
- ${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"
- Delete "$String\tex\latex\cv.cls"
- RMDir /r "$String\tex\latex\lyx"
- RMDir /r "$String\tex\latex\revtex"
- RMDir /r "$String\tex\latex\hollywood"
- RMDir /r "$String\tex\latex\broadway"
- ExecWait "$LatexPath\initexmf --update-fndb"
- ${endif}
-
- ; delete start menu folder
- ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu"
- RMDir /r "$0"
- ; delete desktop icon
- Delete "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk"
- ; delete registry entries
- DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
- DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
- DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
-
- ; run the installer of the old LyX version to clean up the third party products
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "RootKey" "Start" ; dummy entry to let the uninstaller start
- Exec "${PRODUCT_UNINSTALL_EXE_OLD}"
+ !include "Uninstall.nsh"
-SectionEnd
-
; eof
!define PRODUCT_DIR "D:\LyXPackage1.5"
!define PRODUCT_NAME "LyX"
-!define PRODUCT_VERSION "1.5svn-30-04-2007"
+!define PRODUCT_VERSION "1.5svn-02-05-2007"
!define PRODUCT_VERSION_SHORT "150svn"
!define PRODUCT_SUBFOLDER "lyx15"
!define PRODUCT_LICENSE_FILE "${PRODUCT_DIR}\License.txt"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\lyx.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX${PRODUCT_VERSION_SHORT}"
+; definitions for the Update installer
+!if ${INSTALLER_VERSION} == "Update"
+ !define PRODUCT_UNINST_KEY_OLD "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX150svn"
+ !define PRODUCT_VERSION_OLD "LyX 1.5beta2-21-04-2007"
+ !define PRODUCT_UNINSTALL_EXE_OLD "$INSTDIR\LyXWinUninstall.exe"
+ !define PRODUCT_VERSION_SHORT_OLD "150svn"
+ !define JabRefVersionOld "JabRef 2.2"
+ !define MiKTeXDeliveredVersionOld "MiKTeX 2.5"
+!endif
+
+; definitions for the Small installer
+!if ${INSTALLER_VERSION} == "Small"
+ !define JabRefVersion "none" ; dummy entry to avoid NSIS warnig
+ !define MiKTeXDeliveredVersion "none" ; dummy entry to avoid NSIS warnig
+!endif
+
+; definitions for the Complete installer
+!if ${INSTALLER_VERSION} == "Complete"
+ !define GSviewInstall "external\gsv48w32.exe"
+ !define JabRefInstall "external\JabRef-2.2-Setup.exe"
+ !define MiKTeXInstall "$INSTDIR\external\basic-miktex-2.5.2580.exe"
+ !define JabRefVersion "JabRef 2.2"
+ !define MiKTeXDeliveredVersion "MiKTeX 2.5"
+!endif
+
!define ClassFileDir "${PRODUCT_SOURCEDIR}\Resources\tex"
!define ImageMagickVersion "6.3.3"
-!define ImageMagickDir "$INSTDIR\etc\ImageMagick" ; for some odd reason the ImageMagick folder may not be a subfolder of $INSTDIR\bin!
+; for some odd reason the ImageMagick folder may not be a subfolder of $INSTDIR\bin!
+!define ImageMagickDir "$INSTDIR\etc\ImageMagick"
!define GhostscriptDir "$INSTDIR\etc\Ghostscript"
!define GhostscriptVersion "8.56"
!define AiksaurusDir "$APPDATA\Aiksaurus"
OutFile "${INSTALLER_EXE}"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME} ${PRODUCT_VERSION}"
-; -------------------------------
-; Variables used by all installer versions
-
-Var LatexPath
-Var PythonPath
-Var ImageMagickPath
-Var PathPrefix
-Var Answer
-Var UserName
-Var CreateDesktopIcon
-Var StartmenuFolder
-Var ProductRootKey
-Var AppPre
-Var AppSuff
-Var AppPath
-Var String
-Var Search
-Var Pointer
-Var UserList
-Var FileName
-Var OldString
-Var NewString
-
${endif}
; test if JabRef was installed together with LyX
- ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "OnlyWithLyX"
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$JabRefVersionVar" "OnlyWithLyX"
${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
SectionSetText 4 "JabRef" ; names the corersponding uninstaller section
StrCpy $JabRefInstalled "JabRef"
Section "un.MiKTeX" un.SecUnMiKTeX
${if} $MiKTeXInstalled == "MiKTeX" ; only uninstall MiKTeX when it was installed together with LyX
- ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MiKTeXDeliveredVersion}" "UninstallString"
+ ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$MiKTeXVersionVar" "UninstallString"
ExecWait "$1" ; run MiKTeX's uninstaller
${endif}
Section "un.JabRef" un.SecUnJabRef
${if} $JabRefInstalled == "JabRef" ; only uninstall JabRef when it was installed together with LyX
- ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "UninstallString"
+ ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$JabRefVersionVar" "UninstallString"
ExecWait "$1" ; run JabRef's uninstaller
${endif}