NSIS: accept /noautoupdate

This commit is contained in:
Daniel Molkentin 2014-02-12 17:57:50 +01:00
parent 958253bb2b
commit 4db7b5f2a7

View file

@ -54,6 +54,7 @@
!define VERSION "@CPACK_PACKAGE_VERSION@" !define VERSION "@CPACK_PACKAGE_VERSION@"
Var InstallRunIfSilent Var InstallRunIfSilent
Var NoAutomaticUpdates
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Installer build timestamp. ; Installer build timestamp.
@ -628,6 +629,13 @@ Function .onInit
StrCpy $InstallRunIfSilent "yes" StrCpy $InstallRunIfSilent "yes"
${EndIf} ${EndIf}
${GetParameters} $R0
${GetOptions} $R0 "/noautoupdate" $R0
${IfNot} ${Errors}
StrCpy $NoAutomaticUpdates "yes"
${EndIf}
!insertmacro INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" !insertmacro INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
; uncomment this line if you want to see the language selection ; uncomment this line if you want to see the language selection
@ -695,6 +703,10 @@ FunctionEnd
Function .onInstSuccess Function .onInstSuccess
${MementoSectionSave} ${MementoSectionSave}
${If} $NoAutomaticUpdates == "yes"
WriteRegDWORD HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "skipUpdateCheck" "1"
${EndIf}
${If} ${Silent} ${If} ${Silent}
${AndIf} $InstallRunIfSilent == "yes" ${AndIf} $InstallRunIfSilent == "yes"
Call LaunchApplication Call LaunchApplication