]> git.lyx.org Git - features.git/commitdiff
installer bug fixes and infrastructure changes
authorUwe Stöhr <uwestoehr@web.de>
Mon, 30 Apr 2007 00:55:50 +0000 (00:55 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Mon, 30 Apr 2007 00:55:50 +0000 (00:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18104 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/packaging/installer/LyXWinInstaller/Changelog.txt
development/Win32/packaging/installer/LyXWinInstaller/ConfigLyX.nsh
development/Win32/packaging/installer/LyXWinInstaller/InstallActions-complete.nsh
development/Win32/packaging/installer/LyXWinInstaller/InstallActions-small.nsh
development/Win32/packaging/installer/LyXWinInstaller/InstallActions-update.nsh
development/Win32/packaging/installer/LyXWinInstaller/LyXInstaller-complete.nsi
development/Win32/packaging/installer/LyXWinInstaller/LyXInstaller-small.nsi
development/Win32/packaging/installer/LyXWinInstaller/LyXInstaller-update.nsi
development/Win32/packaging/installer/LyXWinInstaller/Settings.nsh
development/Win32/packaging/installer/LyXWinInstaller/Uninstall.nsh

index be4881d44b0b074528118776ba6790bfac78531e..b19b6d04b4c9e15c8463d3b5371c8d445aa3cc74 100644 (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
   - math-macro fixes
   - math delimiter changed again
index 261b7e1cbcf8a8d37d0cb679df907087d437db14..76c53c1c18d60b8c7ee94e3d81b8e2447f25f64e 100644 (file)
@@ -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}"
index 27eb357ef530133ba7b3b44d437c261b4f38a364..7fe02b5fc3e47da83d15c770046fcfcc09d05f3d 100644 (file)
@@ -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
 
 ; -------------------------------------------
index c9f2c4372e05be2309aa88de13d7d8f9b2621c93..ad98405fc953679c059d400f8ec3fa623f58e134 100644 (file)
@@ -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
 
 ; -------------------------------------------
index dd983bb33eb223ffc9390a82c5103de4be7d5fc4..9d3865caf038fbbe82c4cecb648cec8f2fe68e27 100644 (file)
@@ -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,60 +26,27 @@ 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
-  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}"
@@ -85,7 +59,7 @@ Section "-Installation actions" SecInstallation
   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"
@@ -100,8 +74,10 @@ Section "-Installation actions" SecInstallation
   ${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}"
@@ -134,3 +110,101 @@ Section "-Installation actions" SecInstallation
   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
index ff499f0670e6138bbfa55dc63472b31be777679a..67e5ebeb578028f3ec7a5659fb872f7d713719f1 100644 (file)
@@ -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
index c14935824257e985b735f879e03bcaf8d91518f9..a13d02a8be90b2cf3a4a1ac580025637362c2fe9 100644 (file)
@@ -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
index 66274c193b93d46f84ba1e0903a48a8823052e36..2e5a06b90a62feb5a75fe58006f04a4b45f625e5 100644 (file)
@@ -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}
-  
-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
index 590a758fe16c0977cbc2089b05317c235c1b6116..8cbf4f3c58b8523029fb4a486c99554d903e259a 100644 (file)
@@ -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
-
index 224e9dae2366374db6d00932a1823cbc262422ba..733ae8774d6be07e6c9e2fc813b518dd25fb0fba 100644 (file)
@@ -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}