installer: some registry and detection fixes

- detection.nsh:
  - fixed detection of the LaTeX source file editors
  - removed support for obsolete LaTeX source file editors

- init.nsh:
  - don't allow to install an older LyX version over a newer one
  - support dictionaries for new languages that will be supported by LyX 2.1

- remove registry entries of current LyX version when installing a newer version over it
This commit is contained in:
Uwe Stöhr 2012-11-11 07:12:43 +01:00
parent 45b4bd1f0c
commit ea7cf4f5eb
6 changed files with 175 additions and 52 deletions

View File

@ -0,0 +1,37 @@
Changelog for LyX-205-2:
- the installer detects now existing spell-checker and thesaurus dictionaries
of existing LyX installations
- fixed detection for already installed Ghostscript and GSview on 64bit Windows
- fixed detection for jEdit, Vim, WinEdt and TeXnicCenter as LaTeX source file editor
- fixed detection of Gimp and Photoshop as image manipulating program
- updated spell-checker dictionaries for German and Belorussion
(To benefit from them you must uninstall an already installed LyX 2.0.x and
then use this installer.)
- updated thesaurus for German
(need to uninstall to benefit from this)
- bugfix: remove registry entries of existing LyX version when installing over it
- don't allow to install an older LyX version over an existing newer one
Changelog for LyX-205-1:
- installs LyX 2.0.5
- updated to Python 2.7.3
- updated to ImageMagick 6.8.0-4
- updated to Ghostscript 9.06
Changelog for LyX-204-3:
- renamed the proposed LyX installation folder to "LyX 2.0" instead of the former "LyX 2.0.4"
(reason: it should be default be possible to override existing older version of the LyX 2.0.x series)
- link the LyX Wiki and website in LyX's start menu folder Changelog for LyX-204-2:
- Prevent that LyX can first be installed with admin privileges and afterwards without them
- In the uninstaller it is now the default not to uninstall the user preferences and settings
- Fix the path in which the LyX start menu shortcut is executed - Also if LyX is installed without admin privileges, the .lyx file associations are set
- Fix a typo in English translation
Changelog for LyX-204-1:
- It is now possible to install LyX also without administrator privileges.
(Note that the support for the image file formats WMF and EMF can only be installed if LyX is installed with administrator privileges.)
- Added support for multiple indexes in LyX documents
- Support to install spell checker and thesaurus dictionaries for all languages supported by LyX.

View File

@ -38,8 +38,7 @@ FunctionEnd
Function MissingPrograms
# check if third-party programs are installed
# test if Ghostscript is installed
# Ghostscript is a mandatory program for LyX thus check all cases:
# test if Ghostscript is installed, check all cases:
# 1. 32bit Windows
# 2. 64bit Windows but 32bit Ghostscript
# 3. 64bit Windows and 64bit Ghostscript
@ -113,7 +112,7 @@ Function MissingPrograms
ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview64.exe" "Path"
SetRegView 32
${endif}
# repeat for case 2. and 3.
# repeat for case 1. and 2.
${if} $PSVPath == ""
ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"
${endif}
@ -237,75 +236,57 @@ Function EditorCheck
${if} $EditorPath != ""
StrCpy $EditorPath $EditorPath -1 # remove "\" from the end of the string
${endif}
${if} ${RunningX64}
SetRegView 32
${endif}
SetRegView 32
# check for PSPad
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PSPad editor_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $0 $0 -1 # remove the "\"
StrCpy $EditorPath "$EditorPath;$0"
${endif}
# check for WinShell
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinShell_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $0 $0 -1 # remove the "\"
StrCpy $EditorPath "$EditorPath;$0"
${endif}
# check for ConTEXT
# check for Vim which is a 64bit application on x64 Windows
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ConTEXTEditor_is1" "InstallLocation"
${if} ${RunningX64}
SetRegView 64
${endif}
ReadRegStr $0 HKLM "Software\Vim\Gvim" "path"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $0 $0 -9 # remove "\gvim.exe"
StrCpy $EditorPath "$EditorPath;$0"
${endif}
# check for Crimson Editor
SetRegView 32
# check for TeXnicCenter which can be a 64bit application on x64 Windows
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 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
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
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LaTeX Editor" "InstallLocation"
${if} ${RunningX64}
SetRegView 64
${endif}
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1 # remove the "\"
StrCpy $EditorPath "$EditorPath;$0"
${else}
SetRegView 32
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TeXnicCenter_is1" "InstallLocation"
StrCpy $0 $0 -1 # remove the "\"
StrCpy $EditorPath "$EditorPath;$0"
${endif}
SetRegView 32
# check for WinEdt
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt_is1" "InstallLocation"
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinEdt 7" "InstallLocation"
${if} $0 != ""
StrCpy $0 $0 -1
StrCpy $EditorPath "$EditorPath;$0"
${endif}
# 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
StrCpy $0 ""
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinTeX XP" "DisplayIcon"
${if} $0 != ""
StrCpy $0 $0 -11 # remove "\wintex.exe"
StrCpy $EditorPath "$EditorPath;$0"
${endif}

View File

@ -255,6 +255,12 @@ Section /o "Magyar" SecDHungarian
AddSize 3380
SectionEnd
# enable this for LyX 2.1!
#Section /o "Hindi" SecDHindi
# StrCpy $DictCodes "hi_IN,$DictCodes"
# AddSize 1900
#SectionEnd
Section /o "Interlingua" SecDInterlingua
StrCpy $DictCodes "ia_IA,$DictCodes"
AddSize 649
@ -310,6 +316,12 @@ Section /o "Norsk (Nynorsk)" SecDNorwegianNN
AddSize 2890
SectionEnd
# enable this for LyX 2.1!
#Section /o "Occitan" SecDOccitan
# StrCpy $DictCodes "oc_FR,$DictCodes"
# AddSize 31710
#SectionEnd
Section /o "Polski" SecDPolish
StrCpy $DictCodes "pl_PL,$DictCodes"
AddSize 4540
@ -369,6 +381,18 @@ Section /o "Svenska" SecDSwedish
StrCpy $DictCodes "sv_SE,$DictCodes"
AddSize 1030
SectionEnd
# enable this for LyX 2.1!
#Section /o "Tamil" SecDTamil
# StrCpy $DictCodes "ta_IN,$DictCodes"
# AddSize 5911
#SectionEnd
# enable this for LyX 2.1!
#Section /o "Telugu" SecDTelugu
# StrCpy $DictCodes "te_IN,$DictCodes"
# AddSize 3400
#SectionEnd
Section /o "Thai" SecDThai
StrCpy $DictCodes "th_TH,$DictCodes"
@ -380,6 +404,12 @@ Section /o "Ukrainian" SecDUkrainian
AddSize 2620
SectionEnd
# enable this for LyX 2.1!
#Section /o "Urdu" SecDUrdu
# StrCpy $DictCodes "ur_PK,$DictCodes"
# AddSize 1401
#SectionEnd
Section /o "Vietnamese" SecDVietnamese
StrCpy $DictCodes "vi_VN,$DictCodes"
AddSize 40
@ -387,6 +417,7 @@ SectionEnd
SectionGroupEnd
SectionGroup "Thesaurus" SecThesaurus
Section /o "Bulgarian" SecTBulgarian
@ -549,6 +580,8 @@ Function .onInit
Abort
${endif}
!insertmacro MULTIUSER_INIT
# check if this LyX version is already installed
${if} $MultiUser.Privileges == "Admin"
${orif} $MultiUser.Privileges == "Power"
@ -564,9 +597,33 @@ Function .onInit
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
# check if there is an existing LyX installation of the same LyX series
# we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
IntOp $4 ${APP_VERSION_REVISION} + 20
${for} $5 0 $4
${if} $MultiUser.Privileges == "Admin"
${orif} $MultiUser.Privileges == "Power"
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
${else}
ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
${endif}
${if} $0 != ""
StrCpy $R5 $0 # store the read version number
StrCpy $OldVersionNumber "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5"
# we don't stop here because we want the latest installed version
${endif}
${next}
${if} $OldVersionNumber > ${APP_SERIES_KEY}
# store the version number and reformat it temporarily for the error message
StrCpy $R0 $OldVersionNumber
StrCpy $OldVersionNumber $R5
MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)"
StrCpy $OldVersionNumber $R0
Abort
${endif}
!insertmacro PRINTER_INIT
!insertmacro MULTIUSER_INIT
# this can be reset to "true" in section SecDesktop
StrCpy $CreateDesktopIcon "false"
@ -825,6 +882,14 @@ Function .onInit
SectionSetFlags ${SecDHebrew} $0
SectionSetSize ${SecDHebrew} 0
${endif}
StrCpy $Search "hi_IN"
Call StrPoint
${if} $Pointer != "-1"
IntOp $0 ${SF_SELECTED} | ${SF_RO}
# enable this for LyX 2.1!
# SectionSetFlags ${SecDHindi} $0
# SectionSetSize ${SecDHindi} 0
${endif}
StrCpy $Search "hr_HR"
Call StrPoint
${if} $Pointer != "-1"
@ -916,6 +981,14 @@ Function .onInit
SectionSetFlags ${SecDNorwegianNN} $0
SectionSetSize ${SecDNorwegianNN} 0
${endif}
StrCpy $Search "oc_FR"
Call StrPoint
${if} $Pointer != "-1"
IntOp $0 ${SF_SELECTED} | ${SF_RO}
# enable this for LyX 2.1!
# SectionSetFlags ${SecDOccitan} $0
# SectionSetSize ${SecDOccitan} 0
${endif}
StrCpy $Search "pl_PL"
Call StrPoint
${if} $Pointer != "-1"
@ -1000,6 +1073,22 @@ Function .onInit
SectionSetFlags ${SecDSwedish} $0
SectionSetSize ${SecDSwedish} 0
${endif}
StrCpy $Search "ta_IN"
Call StrPoint
${if} $Pointer != "-1"
IntOp $0 ${SF_SELECTED} | ${SF_RO}
# enable this for LyX 2.1!
# SectionSetFlags ${SecDTamil} $0
# SectionSetSize ${SecDTamil} 0
${endif}
StrCpy $Search "te_IN"
Call StrPoint
${if} $Pointer != "-1"
IntOp $0 ${SF_SELECTED} | ${SF_RO}
# enable this for LyX 2.1!
# SectionSetFlags ${SecDTelugu} $0
# SectionSetSize ${SecDTelugu} 0
${endif}
StrCpy $Search "th_TH"
Call StrPoint
${if} $Pointer != "-1"
@ -1014,6 +1103,14 @@ Function .onInit
SectionSetFlags ${SecDUkrainian} $0
SectionSetSize ${SecDUkrainian} 0
${endif}
StrCpy $Search "ur_PK"
Call StrPoint
${if} $Pointer != "-1"
IntOp $0 ${SF_SELECTED} | ${SF_RO}
# enable this for LyX 2.1!
# SectionSetFlags ${SecDUrdu} $0
# SectionSetSize ${SecDUrdu} 0
${endif}
StrCpy $Search "vi_VN"
Call StrPoint
${if} $Pointer != "-1"
@ -1228,11 +1325,11 @@ Function un.onInit
!insertmacro UnAppPreSuff $AppPre $AppSuff # macro from LyXUtils.nsh
# test if MiKTeX was installed together with LyX
ReadRegStr $0 HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
ReadRegStr $0 SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
${if} $0 == "Yes${APP_SERIES_KEY}"
SectionSetText 2 "MiKTeX" # names the corersponding uninstaller section
StrCpy $LaTeXInstalled "MiKTeX"
DeleteRegValue HKLM "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
${else}
SectionSetText 2 "" # hides the corresponding uninstaller section
${endif}

View File

@ -38,6 +38,7 @@ Var LaTeXInstalled
Var LilyPondPath
Var MiKTeXUser
Var MiKTeXVersion
Var OldVersionNumber
Var Pointer
Var PSVPath
Var PythonPath

View File

@ -83,6 +83,8 @@ ${LangFileString} ModifyingConfigureFailed "Could not set 'path_prefix' in the c
#${LangFileString} RunConfigureFailed "Could not execute the configure script"
${LangFileString} InstallRunning "The installer is already running!"
${LangFileString} StillInstalled "LyX ${APP_SERIES_KEY2} is already installed! Deinstall LyX first."
${LangFileString} NewerInstalled "You are trying to install an older version of LyX than what you have installed.$\r$\n\
If you really need this, you must uninstall the existing LyX $OldVersionNumber before."
${LangFileString} MultipleIndexesNotAvailable "The support for using several indexes in a document will not be available because$\r$\n\
MiKTeX was installed with administrator privileges but you are installing LyX without them."

View File

@ -51,6 +51,11 @@ Section -InstallData
WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoRepair" 0x00000001
WriteRegStr SHCTX ${APP_UNINST_KEY} "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
# if we install over an existing version, remove the old uninstaller information
${if} $OldVersionNumber != ""
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}$OldVersionNumber"
${endif}
SectionEnd
#--------------------------------