]> git.lyx.org Git - features.git/blobdiff - development/Win32/packaging/installer/setup/install.nsh
Windows packaging updates.
[features.git] / development / Win32 / packaging / installer / setup / install.nsh
index 3ebfddaf1b46b47a3dde0bade0451f973d0afc72..36013295280b34c967d1cee0f2fa21fcebde528f 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
 
 install.nsh
 
@@ -46,17 +46,25 @@ Section -ProgramFiles SecProgramFiles
   # Binaries
   SetOutPath "$INSTDIR\bin"
   !insertmacro FileListLyXBin File "${FILES_LYX}\bin\"
+  # The 2.3.0 and early 2.3.1 installers used a version suffix
+  # We need to remove the old binaries if we're installing into the same directory
+  Delete "$INSTDIR\bin\LyX2.3.exe"
+  Delete "$INSTDIR\bin\tex2lyx2.3.exe"
   !insertmacro FileListQtBin File "${FILES_QT}\bin\"
-  !insertmacro FileListQtImageformats File "${FILES_QT}\plugins\imageformats\"
-  !insertmacro FileListDll File "${FILES_DEPS}\bin\"
   !insertmacro FileListMSVC File "${FILES_MSVC}\"
   !insertmacro FileListNetpbmBin File "${FILES_NETPBM}\"
   !insertmacro FileListDTLBin File "${FILES_DTL}\"
   !insertmacro FileListRsvg File "${FILES_RSVG}\"
   !insertmacro FileListDvipostBin File "${FILES_DVIPOST}\"
   !insertmacro FileListPDFViewBin File "${FILES_PDFVIEW}\"
-  !insertmacro FileListPDFToolsBin File "${FILES_PDFTOOLS}\"
-  !insertmacro FileListMetaFile2EPS File "${FILES_METAFILE2EPS}\"
+  
+  # Qt plugin DLLs
+  SetOutPath "$INSTDIR\bin\imageformats"
+  !insertmacro FileListQtImageformats File "${FILES_QT}\plugins\imageformats\"
+  SetOutPath "$INSTDIR\bin\iconengines"
+  !insertmacro FileListQtIconengines File "${FILES_QT}\plugins\iconengines\"
+  SetOutPath "$INSTDIR\bin\platforms"
+  !insertmacro FileListQtPlatforms File "${FILES_QT}\plugins\platforms\"
   
   # Resources
   SetOutPath "$INSTDIR"
@@ -65,7 +73,7 @@ Section -ProgramFiles SecProgramFiles
   
   !if ${SETUPTYPE} == BUNDLE
    
-   # extract the Jabref and MiKTeX installer
+   # extract the MiKTeX installer
    File /r "${FILES_LYX}\external"
 
    # install MiKTeX if not already installed
@@ -103,7 +111,6 @@ Section -ProgramFiles SecProgramFiles
   File /r "${FILES_IMAGEMAGICK}\"
   !insertmacro FileListMSVC File "${FILES_MSVC}\"
   # register ImageMagick
-  WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" "$INSTDIR\imagemagick\convert.exe $$"
   WriteRegStr SHCTX "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath" "$INSTDIR\imagemagick"
   WriteRegStr SHCTX "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath" "$INSTDIR\imagemagick\modules\coders"
   WriteRegStr SHCTX "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "ConfigurePath" "$INSTDIR\imagemagick"
@@ -126,52 +133,15 @@ Section -ProgramFiles SecProgramFiles
    StrCpy $GhostscriptPath "$INSTDIR\ghostscript\bin"
   ${endif}
   
-  !if ${SETUPTYPE} == BUNDLE
+  # install eLyXer
+  SetOutPath "$INSTDIR\Python\Lib"
+  !insertmacro FileListeLyXer File "${FILES_ELYXER}\"
    
-   # install JabRef if not already installed and the user selected it
-   # if no BibTeX editor is installed
-   ${if} $PathBibTeXEditor == ""
-   ${andif} $InstallJabRef == "true"
-    # launch installer
-    MessageBox MB_OK|MB_ICONINFORMATION "$(JabRefInfo)" /SD IDOK
-    IfSilent 0 +2
-    ExecWait "$INSTDIR\${JabRefInstall} /S"
-    ExecWait "$INSTDIR\${JabRefInstall}"
-    # test if JabRef is now installed
-    StrCpy $PathBibTeXEditor ""
-    ${if} $MultiUser.Privileges == "Admin"
-     ${orif} $MultiUser.Privileges == "Power"
-     ReadRegStr $PathBibTeXEditor HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
-     StrCpy $PathBibTeXEditor $PathBibTeXEditor -14 # remove "\uninstall.exe"
-    ${else}
-     # for non-admin users we can only check if it is in the start menu
-     ReadRegStr $PathBibTeXEditor HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "StartMenu"
-    ${endif}
-    ${if} $PathBibTeXEditor == ""
-     MessageBox MB_OK|MB_ICONEXCLAMATION "$(JabRefError)" /SD IDOK
-    ${else}
-     # special entry that it was installed together with LyX
-     # so that we can later uninstall it together with LyX
-     ${if} $MultiUser.Privileges == "Admin"
-     ${orif} $MultiUser.Privileges == "Power"
-      WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
-     ${else}
-      WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX" "Yes${APP_SERIES_KEY}"
-     ${endif}
-    ${endif} 
-   ${endif} # end if PathBibTeXEditor
-  !endif # end if BUNDLE
-  
-   # install eLyXer
-   SetOutPath "$INSTDIR\Python\Lib"
-   !insertmacro FileListeLyXer File "${FILES_ELYXER}\"
-   
-   # install unoconv
-   SetOutPath "$INSTDIR\Python\Lib"
-   !insertmacro FileListUnoConv File "${FILES_UNOCONV}\"
+  # install unoconv
+  SetOutPath "$INSTDIR\Python\Lib"
+  !insertmacro FileListUnoConv File "${FILES_UNOCONV}\"
 
   # install the LaTeX class files that are delivered with LyX to MiKTeX
-  # and enable MiKTeX's automatic package installation
   ${if} $LaTeXInstalled == "MiKTeX"
    Call ConfigureMiKTeX # Function from LaTeX.nsh
   ${endif}
@@ -194,125 +164,3 @@ Section -ProgramFiles SecProgramFiles
   WriteUninstaller "$INSTDIR\${SETUP_UNINSTALLER}"
 
 SectionEnd
-
-#--------------------------------
-# Support code for file downloads
-
-!macro DOWNLOAD_FILE RET ID FILENAME APPEND
-
-  # Downloads a file
-  
-  # RET = Return value (OK if succesful)
-  # ID = Name of the download in settings.nsh
-  # FILENAME = Location to store file
-  # APPEND = Filename to append to server location in settings.nsh
-
-  # Try first time
-  NSISdl::download "${DOWNLOAD_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}"
-  Pop ${RET} # Return value (OK if succesful)
-
-  ${If} ${RET} != "success"
-    ${AndIf} ${RET} != "cancel"
-    # Download failed, try once again before giving up
-    # (usally we get a different mirror)
-    NSISdl::download "${DOWNLOAD_${ID}}${APPEND}" "$PLUGINSDIR\${FILENAME}"
-    Pop ${RET}
-  ${EndIf}
-
-!macroend
-
-#--------------------------------
-# External components
-
-#Var PathAllUsers
-#Var PathCurrentUser
-
-!macro EXTERNAL COMPONENT
-
-  # Download/Install the component
-  
-  ${If} $Setup${COMPONENT} == ${TRUE}
-  
-    StrCpy $Path${COMPONENT} "" ;A new one will be installed
-  
-    !ifndef BUNDLESETUP_${COMPONENT}
-      !insertmacro EXTERNAL_DOWNLOAD ${COMPONENT}
-    !else
-      !insertmacro EXTERNAL_INSTALL ${COMPONENT}
-    !endif
-    
-  ${EndIf}
-
-!macroend
-
-!macro EXTERNAL_RUNINSTALLER COMPONENT
-
-  # Run the installer application of the component that does the actual installation.
-
-  install_${COMPONENT}:
-      
-    ExecWait '"$PLUGINSDIR\${COMPONENT}Setup.exe"'
-    
-    # Updates the path environment variable of the installer process to the latest system value
-#    ReadRegStr $PathAllUsers HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path
-#    ReadRegStr $PathCurrentUser HKCU "Environment" Path
-#    System::Call 'kernel32::SetEnvironmentVariableA(t, t) i("Path", "$PathAllUsers;$PathCurrentUser").'
-
-    Call Search${COMPONENT}
-    
-    ${If} $Path${COMPONENT} == ""  
-      MessageBox MB_YESNO|MB_ICONEXCLAMATION $(TEXT_NOTINSTALLED_${COMPONENT}) IDYES install_${COMPONENT}
-    ${EndIf}
-      
-    Delete "$PLUGINSDIR\${COMPONENT}Setup.exe"
-     
-!macroend
-
-!macro EXTERNAL_DOWNLOAD COMPONENT
-
-  download_${COMPONENT}:
-
-    !insertmacro DOWNLOAD_FILE $DownloadResult "${COMPONENT}" "${COMPONENT}Setup.exe" ""
-    ${If} $DownloadResult != "success"
-      ${AndIf} $DownloadResult != "cancel"
-      # Download failed after trying twice - ask user
-      MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_DOWNLOAD_FAILED_${COMPONENT}) ($DownloadResult)" IDYES download_${COMPONENT}
-      Goto noinstall_${COMPONENT}
-    ${EndIf}
-      
-    !insertmacro EXTERNAL_RUNINSTALLER ${COMPONENT}
-      
-  noinstall_${COMPONENT}:
-
-!macroend
-
-!macro EXTERNAL_INSTALL COMPONENT
-
-  # Extract
-  File /oname=$PLUGINSDIR\${COMPONENT}Setup.exe ${FILES_BUNDLE}\${INSTALL_${COMPONENT}}
-    
-  !insertmacro EXTERNAL_RUNINSTALLER ${COMPONENT}
-    
-!macroend
-
-
-# Sections for external components
-
-#Section -LaTeX ExternalLaTeX
-#  !insertmacro EXTERNAL LaTeX
-#SectionEnd
-
-/*Function InitExternal
-
-  # Get sizes of external component installers
-  
-  #SectionGetSize ${ExternalLaTeX} $SizeLaTeX
-  
-  # Add download size
-  
-  !ifndef BUNDLESETUP_MIKTEX
-    IntOp $SizeLaTeX $SizeLaTeX + ${SIZE_DOWNLOAD_LATEX}
-  !endif
-
-FunctionEnd*/