]> git.lyx.org Git - features.git/blobdiff - development/Win32/packaging/installer/setup/configure.nsh
Consider inset strings in simple find/replaceAll (#12049)
[features.git] / development / Win32 / packaging / installer / setup / configure.nsh
index c61fdd33ae433ce2ccf64deb5ed9cfaff9014171..59cf1b4a530d6ae94a7f1c43de55e50f1c3df12b 100644 (file)
@@ -16,6 +16,10 @@ Var PathPrefix
 Section -InstallData
 
   # Registry information
+  ReadRegStr $0 SHCTX ${APP_REGFOLDER} "latestVersion"
+  ${If} $0 < ${APP_SERIES_KEY}
+    WriteRegStr SHCTX ${APP_REGFOLDER} "latestVersion" ${APP_SERIES_KEY}
+  ${EndIf}
   WriteRegStr SHCTX ${APP_REGKEY} "" $INSTDIR
   WriteRegStr SHCTX ${APP_REGKEY} "Version" "${APP_VERSION_NUMBER}"
   WriteRegStr SHCTX ${APP_REGKEY_SETUP} "LaTeX Path" $PathLaTeX
@@ -46,7 +50,7 @@ Section -InstallData
   
   WriteRegStr SHCTX ${APP_UNINST_KEY} "UninstallString" '"$INSTDIR\${SETUP_UNINSTALLER}"'
   WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayVersion" "${APP_VERSION}"
-  WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\lyx,0"
+  WriteRegStr SHCTX ${APP_UNINST_KEY} "DisplayIcon" "$INSTDIR\bin\${APP_NAME_SMALL}.exe"
   WriteRegStr SHCTX ${APP_UNINST_KEY} "URLUpdateInfo" "${APP_WEBPAGE}"
   WriteRegStr SHCTX ${APP_UNINST_KEY} "URLInfoAbout" "https://www.lyx.org/AboutLyX"
   WriteRegStr SHCTX ${APP_UNINST_KEY} "Publisher" "${APP_NAME} Team"
@@ -54,14 +58,17 @@ Section -InstallData
   WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoModify" 0x00000001
   WriteRegDWORD SHCTX ${APP_UNINST_KEY} "NoRepair" 0x00000001
   WriteRegStr SHCTX ${APP_UNINST_KEY} "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
-  
   # if we install over an older existing version, remove the old uninstaller information
-  ${if} $OldVersionNumber < ${APP_SERIES_KEY}
+  ${if} $OldVersionNumber != ""
+  ${AndIf} $OldVersionNumber < ${APP_SERIES_KEY}
    DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}$OldVersionNumber"
+   DeleteRegKey SHCTX "SOFTWARE\${APP_NAME}\$OldVersionNumber"
    # also delete in the case of an emergency release
-   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}$OldVersionNumber1"
+   ${For} $7 0 20
+    DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}$OldVersionNumber$7"
+    DeleteRegKey SHCTX "SOFTWARE\${APP_NAME}\$OldVersionNumber$7"
+   ${Next}
   ${endif}
-  
 SectionEnd
 
 #--------------------------------
@@ -157,10 +164,8 @@ Section -Configure
   
   # Set the path prefix in lyxrc.dist
   ClearErrors
-  Delete "$INSTDIR\Resources\lyxrc.dist"
-  FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" w
-  # set the format to the latest LyXRC format
-  FileWrite $R1 'Format 24$\r$\n'
+  FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" a
+  FileSeek $R1 0 END
   # set some general things
   FileWrite $R1 '\screen_zoom 120$\r$\n'
   ${if} "$PathPrefix" != ""
@@ -216,12 +221,14 @@ Section -Configure
   ClearErrors
   
   # for texindy the path to the perl.exe must unfortunately be in Windows' PATH variable
-  ${if} $MultiUser.Privileges != "Admin"
-  ${andif} $MultiUser.Privileges != "Power"
-   # call the non-admin version
-   ${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$INSTDIR\Perl\bin"
-  ${else}
-   ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\Perl\bin"
+  ${if} $LaTeXInstalled != "TeXLive"
+    ${if} $MultiUser.Privileges != "Admin"
+    ${andif} $MultiUser.Privileges != "Power"
+    # call the non-admin version
+    ${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$INSTDIR\Perl\bin"
+    ${else}
+    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\Perl\bin"
+    ${endif}
   ${endif}
 
 SectionEnd
@@ -233,31 +240,9 @@ Var ConfigureReturn
 
 Section -ConfigureScript
 
-  SetOutPath "$INSTDIR\Resources"
-  
-  # ask to update MiKTeX
-  ${if} $LaTeXInstalled == "MiKTeX"
-   Call UpdateMiKTeX # function from latex.nsh
-   # install all necessary packages at once because this is much faster then to install the packages one by one
-   DetailPrint $(TEXT_CONFIGURE_LYX)
-   ${if} $MultiUser.Privileges != "Admin"
-   ${andif} $MultiUser.Privileges != "Power"
-    # call the non-admin version
-    # at first we need to synchronize the package database
-    nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--verbose" "--update-db"'
-    nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--verbose" "--require=@$INSTDIR\Resources\Packages.txt"'
-   ${else}
-    ${if} $MiKTeXUser != "HKCU" # call the admin version
-     nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--verbose" "--update-db"'
-     nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--verbose" "--require=@$INSTDIR\Resources\Packages.txt"'
-    ${else}
-     nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--verbose" "--update-db"'
-     nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--verbose" "--require=@$INSTDIR\Resources\Packages.txt"'
-    ${endif}
-   ${endif}
-  ${endif}
-  
   DetailPrint $(TEXT_CONFIGURE_LYX)
+  SetShellVarContext current
+  SetOutPath "$APPDATA\${APP_DIR_USERDATA}"
   nsExec::ExecToLog '"$INSTDIR\Python\python.exe" "$INSTDIR\Resources\configure.py"'
   # $ConfigureReturn is "0" if successful, otherwise "1"
   Pop $ConfigureReturn # Return value
@@ -267,11 +252,11 @@ SectionEnd
 #--------------------------------
 #
 
-Function StartLyX
+#Function StartLyX
 
   # run LyX in a command line window to give the users feedback about
   # the time consuming LaTeX package installation
   
-  Exec "$INSTDIR\${APP_RUN}"
+#  Exec "$INSTDIR\${APP_RUN}"
 
-FunctionEnd
+#FunctionEnd