From 2dc0ec25d3b256c5c5ce11f89195117328a690a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Tue, 18 Feb 2014 02:15:53 +0100 Subject: [PATCH] installer: enable to run it silently --- .../packaging/installer/include/LaTeX.nsh | 8 ++++---- .../Win32/packaging/installer/include/init.nsh | 18 +++++++++--------- .../packaging/installer/setup/configure.nsh | 6 ++++-- .../packaging/installer/setup/install.nsh | 6 ++++-- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/development/Win32/packaging/installer/include/LaTeX.nsh b/development/Win32/packaging/installer/include/LaTeX.nsh index 78833133c4..70d50a8fe3 100644 --- a/development/Win32/packaging/installer/include/LaTeX.nsh +++ b/development/Win32/packaging/installer/include/LaTeX.nsh @@ -207,7 +207,7 @@ FunctionEnd ${if} $PathLaTeX == "" # launch MiKTeX's installer - MessageBox MB_OK|MB_ICONINFORMATION "$(LatexInfo)" + MessageBox MB_OK|MB_ICONINFORMATION "$(LatexInfo)" /SD IDOK ExecWait ${MiKTeXInstall} # test if MiKTeX is installed Call LaTeXActions @@ -225,7 +225,7 @@ FunctionEnd StrCpy $LaTeXInstalled "MiKTeX" StrCpy $MiKTeXVersion ${MiKTeXDeliveredVersion} ${else} - MessageBox MB_OK|MB_ICONSTOP "$(LatexError1)" + MessageBox MB_OK|MB_ICONSTOP "$(LatexError1)" /SD IDOK SetOutPath $TEMP # to be able to delete the $INSTDIR RMDir /r $INSTDIR Abort @@ -286,7 +286,7 @@ Function ConfigureMiKTeX ${andif} $MultiUser.Privileges != "Power" ${if} $0 == "" ${ifnot} ${FileExists} "$PathLaTeX\perl.exe" - MessageBox MB_OK|MB_ICONINFORMATION "$(MultipleIndexesNotAvailable)" + MessageBox MB_OK|MB_ICONINFORMATION "$(MultipleIndexesNotAvailable)" /SD IDOK ${endif} ${else} # ${FileExists} is disabled for now to repair existing LyX installations using 64bit MiKTeX @@ -413,7 +413,7 @@ FunctionEnd Function UpdateMiKTeX # asks to update MiKTeX - MessageBox MB_YESNO|MB_ICONINFORMATION "$(MiKTeXInfo)" IDYES UpdateNow IDNO UpdateLater + MessageBox MB_YESNO|MB_ICONINFORMATION "$(MiKTeXInfo)" /SD IDNO IDYES UpdateNow IDNO UpdateLater UpdateNow: # the update wizard is started by the miktex-update.exe ${if} $MultiUser.Privileges != "Admin" diff --git a/development/Win32/packaging/installer/include/init.nsh b/development/Win32/packaging/installer/include/init.nsh index 184e921b8b..eb5f7f1a0a 100644 --- a/development/Win32/packaging/installer/include/init.nsh +++ b/development/Win32/packaging/installer/include/init.nsh @@ -585,7 +585,7 @@ Function .onInit ${IfNot} ${IsNT} ${OrIfNot} ${AtLeastWinXP} - MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later." + MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows XP or later." /SD IDOK Quit ${EndIf} @@ -593,13 +593,13 @@ Function .onInit System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${BundleExeFile}.Instance") i .r1 ?e' Pop $R0 ${if} $R0 != "0" - MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" + MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK Abort ${endif} System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ExeFile}.Instance") i .r1 ?e' Pop $R0 ${if} $R0 != "0" - MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" + MessageBox MB_OK|MB_ICONSTOP "$(InstallRunning)" /SD IDOK Abort ${endif} @@ -626,7 +626,7 @@ Function .onInit ${endif} ${endif} ${if} $0 != "" - MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)" + MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)" /SD IDOK Abort ${endif} @@ -659,7 +659,7 @@ Function .onInit # store the version number and reformat it temporarily for the error message StrCpy $R0 $OldVersionNumber StrCpy $OldVersionNumber $R5 - MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)" + MessageBox MB_OK|MB_ICONSTOP "$(NewerInstalled)" /SD IDOK StrCpy $OldVersionNumber $R0 Abort ${endif} @@ -1359,7 +1359,7 @@ Function un.onInit # Check that LyX is not currently running FindProcDLL::FindProc "lyx.exe" ${if} $R0 == "1" - MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" + MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)" /SD IDOK Abort ${endif} @@ -1377,14 +1377,14 @@ Function un.onInit ${if} $0 != "" ${andif} $MultiUser.Privileges != "Admin" ${andif} $MultiUser.Privileges != "Power" - MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)" + MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)" /SD IDOK Abort ${endif} # warning when LyX couldn't be found in the registry ${if} $0 == "" # check in HKCU ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "DisplayVersion" ${if} $0 == "" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)" + MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)" /SD IDOK ${endif} ${endif} @@ -1410,7 +1410,7 @@ Function un.onInit ${endif} # question message if the user really wants to uninstall LyX - MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 # continue if yes + MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" /SD IDYES IDYES +2 # continue if yes Abort FunctionEnd diff --git a/development/Win32/packaging/installer/setup/configure.nsh b/development/Win32/packaging/installer/setup/configure.nsh index 0601a1da90..f8040ae9a9 100644 --- a/development/Win32/packaging/installer/setup/configure.nsh +++ b/development/Win32/packaging/installer/setup/configure.nsh @@ -22,6 +22,8 @@ Section -InstallData # Start Menu shortcut SetOutPath "$INSTDIR\bin" # this is the folder in which the shortcut is executed + IfSilent 0 +2 + StrCpy $StartmenuFolder "${APP_DIR}" CreateDirectory "$SMPROGRAMS\$StartmenuFolder" CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${APP_NAME}.lnk" "$INSTDIR\${APP_RUN}" "" "$INSTDIR\${APP_RUN}" "" "" "" "${APP_INFO}" # Link to www.lyx.org and to the Wiki @@ -170,7 +172,7 @@ Section -Configure ${endif} FileClose $R1 IfErrors 0 +2 - MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)" + MessageBox MB_OK|MB_ICONEXCLAMATION "$(ModifyingConfigureFailed)" /SD IDOK ClearErrors SectionEnd @@ -187,7 +189,7 @@ Section -PSPrinter # Install printer and driver ExecWait '$PrinterConf /if /f "$WINDIR\inf\ntprint.inf" /b "Metafile to EPS Converter" /r "FILE:" /m "MS Publisher Imagesetter"' ${else} - MessageBox MB_OK|MB_ICONINFORMATION "$(MetafileNotAvailable)" + MessageBox MB_OK|MB_ICONINFORMATION "$(MetafileNotAvailable)" /SD IDOK ${endif} SectionEnd diff --git a/development/Win32/packaging/installer/setup/install.nsh b/development/Win32/packaging/installer/setup/install.nsh index 27e5fba10c..262fec5025 100644 --- a/development/Win32/packaging/installer/setup/install.nsh +++ b/development/Win32/packaging/installer/setup/install.nsh @@ -114,7 +114,9 @@ Section -ProgramFiles SecProgramFiles ${if} $PathBibTeXEditor == "" ${andif} $InstallJabRef == "true" # launch installer - MessageBox MB_OK|MB_ICONINFORMATION "$(JabRefInfo)" + 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 "" @@ -127,7 +129,7 @@ Section -ProgramFiles SecProgramFiles ReadRegStr $PathBibTeXEditor HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "StartMenu" ${endif} ${if} $PathBibTeXEditor == "" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(JabRefError)" + 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 -- 2.39.2