installer bug fixes and infrastructure changes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18104 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-04-30 00:55:50 +00:00
parent e0d54dd3b4
commit 4a5ed9feee
10 changed files with 319 additions and 212 deletions

View File

@ -1,4 +1,14 @@
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 - LyX 1.5 beta2 from 21-04-2007
- math-macro fixes - math-macro fixes
- math delimiter changed again - math delimiter changed again

View File

@ -70,7 +70,9 @@ Function ConfigureLyX
${endif} ${endif}
; register LyX ; register LyX
${if} $CreateFileAssociations == "true"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
${endif}
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey" 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}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}" WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"

View File

@ -3,6 +3,11 @@
; The '-' makes the section invisible. ; The '-' makes the section invisible.
Section "-Installation actions" SecInstallation Section "-Installation actions" SecInstallation
; dummy actions to avoid NSIS warnings
StrCpy $FileName ""
StrCpy $NewString ""
StrCpy $OldString ""
; extract all files ; extract all files
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File /r "${PRODUCT_SOURCEDIR}\bin" File /r "${PRODUCT_SOURCEDIR}\bin"
@ -13,16 +18,22 @@ Section "-Installation actions" SecInstallation
; install MiKTeX if not already installed ; install MiKTeX if not already installed
Call MiKTeX Call MiKTeX
; install Ghostscript if it not installed
Call Ghostscript Call Ghostscript
; install ImageMagick if it not installed
Call ImageMagick Call ImageMagick
; install ImageMAspellagick if it not installed
Call Aspell Call Aspell
; install Aiksaurus if it not installed
Call Aiksaurus Call Aiksaurus
; install GSview if it not installed and the user selected it
Call PostScript Call PostScript
; install JabRef if it not installed and the user selected it
Call BibTeX Call BibTeX
; install the LaTeX class files that are delivered with LyX ; install the LaTeX class files that are delivered with LyX
@ -85,6 +96,10 @@ Section "-Installation actions" SecInstallation
FileWrite $R1 '$LaTeXPath' FileWrite $R1 '$LaTeXPath'
FileClose $R1 FileClose $R1
; prepare variables for uninstaller
StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersion}
StrCpy $JabRefVersionVar ${JabRefVersion}
SectionEnd SectionEnd
; ------------------------------------------- ; -------------------------------------------

View File

@ -3,18 +3,27 @@
; The '-' makes the section invisible. ; The '-' makes the section invisible.
Section "-Installation actions" SecInstallation Section "-Installation actions" SecInstallation
; dummy actions to avoid NSIS warnings
StrCpy $FileName ""
StrCpy $NewString ""
StrCpy $OldString ""
; extract all files ; extract all files
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File /r "${PRODUCT_SOURCEDIR}\bin" File /r "${PRODUCT_SOURCEDIR}\bin"
File /r "${PRODUCT_SOURCEDIR}\etc" File /r "${PRODUCT_SOURCEDIR}\etc"
File /r "${PRODUCT_SOURCEDIR}\Resources" File /r "${PRODUCT_SOURCEDIR}\Resources"
; install GhostScript if it not installed
Call Ghostscript Call Ghostscript
; install ImageMagick if it not installed
Call ImageMagick Call ImageMagick
; install Aspell if it not installed
Call Aspell Call Aspell
; install Aiksaurus if it not installed
Call Aiksaurus Call Aiksaurus
; install the LaTeX class files that are delivered with LyX ; install the LaTeX class files that are delivered with LyX
@ -77,6 +86,10 @@ Section "-Installation actions" SecInstallation
FileWrite $R1 '$LaTeXPath' FileWrite $R1 '$LaTeXPath'
FileClose $R1 FileClose $R1
; prepare variables for uninstaller
StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersion}
StrCpy $JabRefVersionVar ${JabRefVersion}
SectionEnd SectionEnd
; ------------------------------------------- ; -------------------------------------------

View File

@ -3,6 +3,13 @@
; The '-' makes the section invisible. ; The '-' makes the section invisible.
Section "-Installation actions" SecInstallation Section "-Installation actions" SecInstallation
; dummy actions to avoid NSIS warnings
StrCpy $AspellBaseReg ""
StrCpy $LangCode ""
StrCpy $LangCodeSys ""
StrCpy $LangName ""
StrCpy $LangNameSys ""
; extract modified files ; extract modified files
Call UpdateModifiedFiles ; macro from Updated.nsh Call UpdateModifiedFiles ; macro from Updated.nsh
@ -19,15 +26,98 @@ Section "-Installation actions" SecInstallation
Delete "$DESKTOP\${PRODUCT_VERSION_OLD}.lnk" Delete "$DESKTOP\${PRODUCT_VERSION_OLD}.lnk"
; delete old registry entries ; delete old registry entries
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY_OLD}" ${if} $CreateFileAssociations == "true"
DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}" DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
DeleteRegKey HKCR "Applications\lyx.bat"
; remove extension .lyx ; remove extension .lyx
${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
${endif}
DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY_OLD}"
DeleteRegKey HKCR "Applications\lyx.bat"
DeleteRegKey HKCR "${PRODUCT_NAME}" DeleteRegKey HKCR "${PRODUCT_NAME}"
; determine the new name of the install location, ; determine the new name of the install location,
; only when the user has used the default path settings of the previous LyX-version ; 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
; Refresh registry setings for the uninstaller
Call RefreshRegUninst
; register LyX
${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}" "DisplayIcon" "${PRODUCT_EXE}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_INFO_URL}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_ABOUT_URL}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "LyX Team"
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"
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
; create desktop icon
${if} $CreateDesktopIcon == "true"
SetOutPath "$INSTDIR\bin"
CreateShortCut "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
${endif}
; 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 Uninstaller
WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
; 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 $PythonPath "$INSTDIR\bin"
${else}
StrCpy $PythonPath $PythonPath -1 ; remove the "\" at the end
${endif}
; 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 '"$PythonPath\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 '$1$\r$\n\
cd $INSTDIR\Resources\$\r$\n\
"$PythonPath\python.exe" configure.py'
FileClose $R1
MessageBox MB_OK|MB_ICONINFORMATION "$(LatexConfigInfo)"
ExecWait '"$INSTDIR\Resources\configLyX.bat"'
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 $String $INSTDIR
StrCpy $Search "${PRODUCT_VERSION_OLD}" StrCpy $Search "${PRODUCT_VERSION_OLD}"
StrLen $3 $String StrLen $3 $String
@ -71,66 +161,50 @@ Section "-Installation actions" SecInstallation
${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed) ${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed)
; register LyX FunctionEnd
WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
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}" "DisplayIcon" "${PRODUCT_EXE}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_INFO_URL}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_ABOUT_URL}"
WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "LyX Team"
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"
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
; create desktop icon Function RefreshRegUninst
${if} $CreateDesktopIcon == "true"
SetOutPath "$INSTDIR\bin" ; Refresh registry setings for the uninstaller
CreateShortCut "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
; 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} ${endif}
; register the extension .lyx ; MiKTeX
${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}" ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}" ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
WriteRegStr HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
; create Uninstaller StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersionOld}
WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
; 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 $PythonPath "$INSTDIR\bin"
${else}
StrCpy $PythonPath $PythonPath -1 ; remove the "\" at the end
${endif} ${endif}
; run LyX's configure script ; JabRef
; create a bat-file to start configure in a console window so that the user see the progress ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersionOld}" "OnlyWithLyX"
; of the configuration and to have a signal when the configuration is ready to start LyX ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
; this is important when LyX is installed together with MiKTeX or when LyX is installed for the first WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersionOld}" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}"
; time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes StrCpy $JabRefVersionVar ${JabRefVersionOld}
; a batch file is needed because simply calling ExecWait '"$PythonPath\python.exe" "$INSTDIR\Resources\configure.py"' ${endif}
; creates the config files in $INSTDIR\bin
StrCpy $1 $INSTDIR 2 ; get drive letter
FileOpen $R1 "$INSTDIR\Resources\configLyX.bat" w
FileWrite $R1 '$1$\r$\n\
cd $INSTDIR\Resources\$\r$\n\
"$PythonPath\python.exe" configure.py'
FileClose $R1
MessageBox MB_OK|MB_ICONINFORMATION "$(LatexConfigInfo)"
ExecWait '"$INSTDIR\Resources\configLyX.bat"'
Delete "$INSTDIR\Resources\configLyX.bat"
SectionEnd ; 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

View File

@ -31,13 +31,6 @@ CRCCheck force
; load the settings ; load the settings
!include "Settings.nsh" !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 ; variables only used in this installer version
@ -45,32 +38,54 @@ Var DelPythonFiles
Var GhostscriptPath Var GhostscriptPath
Var AiksaurusPath Var AiksaurusPath
Var AspellPath Var AspellPath
Var AspellInstallYes
Var AspellBaseReg
Var AspellMessage
Var Acrobat Var Acrobat
Var PSVPath Var PSVPath
Var EditorPath Var EditorPath
Var ImageEditorPath Var ImageEditorPath
Var BibTeXEditorPath Var BibTeXEditorPath
Var JabRefInstalled
Var LangName
Var LangNameSys
Var LangCode
Var LangCodeSys
Var LangEncoding Var LangEncoding
Var LangSysEncoding Var LangSysEncoding
Var DictCode
Var MissedProg Var MissedProg
Var LaTeXName Var LaTeXName
Var MiKTeXVersion Var MiKTeXVersion
Var MiKTeXInstalled
Var MiKTeXUser Var MiKTeXUser
Var MiKTeXPath Var MiKTeXPath
Var InstallGSview Var InstallGSview
Var InstallJabRef 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 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 RunNumber
Var StartmenuFolder
Var String
Var Search
Var UserList
Var UserName
;-------------------------------- ;--------------------------------
; load some NSIS libraries ; load some NSIS libraries

View File

@ -31,10 +31,6 @@ CRCCheck force
; load the settings ; load the settings
!include "Settings.nsh" !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 ; variables only used in this installer version
@ -42,30 +38,52 @@ Var DelPythonFiles
Var GhostscriptPath Var GhostscriptPath
Var AiksaurusPath Var AiksaurusPath
Var AspellPath Var AspellPath
Var AspellInstallYes
Var AspellBaseReg
Var AspellMessage
Var Acrobat Var Acrobat
Var PSVPath Var PSVPath
Var EditorPath Var EditorPath
Var ImageEditorPath Var ImageEditorPath
Var BibTeXEditorPath Var BibTeXEditorPath
Var JabRefInstalled
Var LangName
Var LangNameSys
Var LangCode
Var LangCodeSys
Var LangEncoding Var LangEncoding
Var LangSysEncoding Var LangSysEncoding
Var DictCode
Var MissedProg Var MissedProg
Var LaTeXName Var LaTeXName
Var MiKTeXVersion Var MiKTeXVersion
Var MiKTeXInstalled
Var MiKTeXUser Var MiKTeXUser
Var CreateFileAssociations
Var State 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 RunNumber
Var StartmenuFolder
Var String
Var Search
Var UserList
Var UserName
;-------------------------------- ;--------------------------------
; load some NSIS libraries ; load some NSIS libraries

View File

@ -31,14 +31,44 @@ SetCompressor lzma
; load the settings ; load the settings
!include "Settings.nsh" !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 ; variables only used in this installer version
Var INSTDIR_NEW 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 ; load some NSIS libraries
@ -65,6 +95,9 @@ Var INSTDIR_NEW
; list with deleted files ; list with deleted files
!include "Deleted.nsh" !include "Deleted.nsh"
; Function for page to install Aspell dictionaries
!include "Aspell.nsh"
;-------------------------------- ;--------------------------------
; Remember the installer language ; Remember the installer language
@ -160,6 +193,9 @@ LicenseData "$(LyXLicenseData)"
Section "!${PRODUCT_NAME}" SecCore Section "!${PRODUCT_NAME}" SecCore
SectionIn RO SectionIn RO
SectionEnd SectionEnd
Section "$(SecFileAssocTitle)" SecFileAssoc
StrCpy $CreateFileAssociations "true"
SectionEnd
Section "$(SecDesktopTitle)" SecDesktop Section "$(SecDesktopTitle)" SecDesktop
StrCpy $CreateDesktopIcon "true" StrCpy $CreateDesktopIcon "true"
SectionEnd SectionEnd
@ -252,86 +288,7 @@ FunctionEnd
;-------------------------------- ;--------------------------------
; The Uninstaller ; The Uninstaller
Function un.onInit !include "Uninstall.nsh"
; 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}"
SectionEnd
; eof ; eof

View File

@ -3,7 +3,7 @@
!define PRODUCT_DIR "D:\LyXPackage1.5" !define PRODUCT_DIR "D:\LyXPackage1.5"
!define PRODUCT_NAME "LyX" !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_VERSION_SHORT "150svn"
!define PRODUCT_SUBFOLDER "lyx15" !define PRODUCT_SUBFOLDER "lyx15"
!define PRODUCT_LICENSE_FILE "${PRODUCT_DIR}\License.txt" !define PRODUCT_LICENSE_FILE "${PRODUCT_DIR}\License.txt"
@ -31,10 +31,36 @@ BrandingText "LyXWinInstaller v3.14 - ${INSTALLER_VERSION}"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\lyx.exe" !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}" !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 ClassFileDir "${PRODUCT_SOURCEDIR}\Resources\tex"
!define ImageMagickVersion "6.3.3" !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 GhostscriptDir "$INSTDIR\etc\Ghostscript"
!define GhostscriptVersion "8.56" !define GhostscriptVersion "8.56"
!define AiksaurusDir "$APPDATA\Aiksaurus" !define AiksaurusDir "$APPDATA\Aiksaurus"
@ -60,26 +86,3 @@ Name "${PRODUCT_NAME}"
OutFile "${INSTALLER_EXE}" OutFile "${INSTALLER_EXE}"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME} ${PRODUCT_VERSION}" 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

View File

@ -57,7 +57,7 @@ Function un.onInit
${endif} ${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" ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$JabRefVersionVar" "OnlyWithLyX"
${if} $0 == "Yes${PRODUCT_VERSION_SHORT}" ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
SectionSetText 4 "JabRef" ; names the corersponding uninstaller section SectionSetText 4 "JabRef" ; names the corersponding uninstaller section
StrCpy $JabRefInstalled "JabRef" StrCpy $JabRefInstalled "JabRef"
@ -198,7 +198,7 @@ SectionEnd
Section "un.MiKTeX" un.SecUnMiKTeX Section "un.MiKTeX" un.SecUnMiKTeX
${if} $MiKTeXInstalled == "MiKTeX" ; only uninstall MiKTeX when it was installed together with LyX ${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 ExecWait "$1" ; run MiKTeX's uninstaller
${endif} ${endif}
@ -209,7 +209,7 @@ SectionEnd
Section "un.JabRef" un.SecUnJabRef Section "un.JabRef" un.SecUnJabRef
${if} $JabRefInstalled == "JabRef" ; only uninstall JabRef when it was installed together with LyX ${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 ExecWait "$1" ; run JabRef's uninstaller
${endif} ${endif}