installer: enable to run it silently

This commit is contained in:
Uwe Stöhr 2014-02-18 02:15:53 +01:00
parent 59828e02bc
commit 2dc0ec25d3
4 changed files with 21 additions and 17 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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