mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
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:
parent
e0d54dd3b4
commit
4a5ed9feee
@ -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
|
||||
- math-macro fixes
|
||||
- math delimiter changed again
|
||||
|
@ -70,7 +70,9 @@ Function ConfigureLyX
|
||||
${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}"
|
||||
|
@ -3,6 +3,11 @@
|
||||
; 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"
|
||||
@ -13,16 +18,22 @@ Section "-Installation actions" SecInstallation
|
||||
; 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
|
||||
@ -85,6 +96,10 @@ Section "-Installation actions" SecInstallation
|
||||
FileWrite $R1 '$LaTeXPath'
|
||||
FileClose $R1
|
||||
|
||||
; prepare variables for uninstaller
|
||||
StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersion}
|
||||
StrCpy $JabRefVersionVar ${JabRefVersion}
|
||||
|
||||
SectionEnd
|
||||
|
||||
; -------------------------------------------
|
||||
|
@ -3,18 +3,27 @@
|
||||
; 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
|
||||
@ -77,6 +86,10 @@ Section "-Installation actions" SecInstallation
|
||||
FileWrite $R1 '$LaTeXPath'
|
||||
FileClose $R1
|
||||
|
||||
; prepare variables for uninstaller
|
||||
StrCpy $MiKTeXVersionVar ${MiKTeXDeliveredVersion}
|
||||
StrCpy $JabRefVersionVar ${JabRefVersion}
|
||||
|
||||
SectionEnd
|
||||
|
||||
; -------------------------------------------
|
||||
|
@ -3,6 +3,13 @@
|
||||
; 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
|
||||
|
||||
@ -11,7 +18,7 @@ Section "-Installation actions" SecInstallation
|
||||
|
||||
; delete old uninstaller
|
||||
Delete "${PRODUCT_UNINSTALL_EXE}"
|
||||
|
||||
|
||||
; delete old start menu folder
|
||||
ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY_OLD}" "StartMenu"
|
||||
RMDir /r $0
|
||||
@ -19,15 +26,98 @@ Section "-Installation actions" SecInstallation
|
||||
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
|
||||
; 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 $Search "${PRODUCT_VERSION_OLD}"
|
||||
StrLen $3 $String
|
||||
@ -71,66 +161,50 @@ Section "-Installation actions" SecInstallation
|
||||
|
||||
${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed)
|
||||
|
||||
; register LyX
|
||||
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
|
||||
${if} $CreateDesktopIcon == "true"
|
||||
SetOutPath "$INSTDIR\bin"
|
||||
CreateShortCut "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
|
||||
${endif}
|
||||
|
||||
; register the extension .lyx
|
||||
${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
|
||||
${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
|
||||
|
||||
; 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"
|
||||
FunctionEnd
|
||||
|
||||
SectionEnd
|
||||
; -------------------------------------------
|
||||
|
||||
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
|
||||
|
@ -31,13 +31,6 @@ CRCCheck force
|
||||
; 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
|
||||
|
||||
@ -45,32 +38,54 @@ Var DelPythonFiles
|
||||
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
|
||||
|
@ -31,10 +31,6 @@ CRCCheck force
|
||||
; 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
|
||||
|
||||
@ -42,30 +38,52 @@ Var DelPythonFiles
|
||||
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
|
||||
|
@ -31,14 +31,44 @@ SetCompressor lzma
|
||||
; 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
|
||||
@ -65,6 +95,9 @@ Var INSTDIR_NEW
|
||||
; list with deleted files
|
||||
!include "Deleted.nsh"
|
||||
|
||||
; Function for page to install Aspell dictionaries
|
||||
!include "Aspell.nsh"
|
||||
|
||||
;--------------------------------
|
||||
|
||||
; Remember the installer language
|
||||
@ -160,6 +193,9 @@ LicenseData "$(LyXLicenseData)"
|
||||
Section "!${PRODUCT_NAME}" SecCore
|
||||
SectionIn RO
|
||||
SectionEnd
|
||||
Section "$(SecFileAssocTitle)" SecFileAssoc
|
||||
StrCpy $CreateFileAssociations "true"
|
||||
SectionEnd
|
||||
Section "$(SecDesktopTitle)" SecDesktop
|
||||
StrCpy $CreateDesktopIcon "true"
|
||||
SectionEnd
|
||||
@ -252,86 +288,7 @@ FunctionEnd
|
||||
;--------------------------------
|
||||
; 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}
|
||||
!include "Uninstall.nsh"
|
||||
|
||||
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
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
!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"
|
||||
@ -31,10 +31,36 @@ BrandingText "LyXWinInstaller v3.14 - ${INSTALLER_VERSION}"
|
||||
!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"
|
||||
@ -60,26 +86,3 @@ Name "${PRODUCT_NAME}"
|
||||
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
|
||||
|
||||
|
@ -57,7 +57,7 @@ Function un.onInit
|
||||
${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"
|
||||
@ -198,7 +198,7 @@ SectionEnd
|
||||
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}
|
||||
|
||||
@ -209,7 +209,7 @@ SectionEnd
|
||||
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}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user