commit a1c83970bec656a5668ca8a5cfb94cf011daa22a
parent 9d9df7981afe3469934906e60bae7d6836dbaf84
Author: Duncan McIntosh <dmcintosh@mozilla.com>
Date: Tue, 21 Oct 2025 22:03:02 +0000
Bug 1990965 - Part 1: Honour the /Prompt stub installer argument even if other parameters are passed. r=cdupuis,browser-installer-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D266502
Diffstat:
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/browser/installer/windows/nsis/stub.nsi b/browser/installer/windows/nsis/stub.nsi
@@ -137,17 +137,21 @@ Function PromptForInstall
FunctionEnd
Function .onInit
+ ; After elevation, this is re-run with /UAC: on the command line. In this
+ ; case, we do not want to prompt the user---they've already been prompted!
${GetParameters} $0
- ; If the only parameter is "/Prompt", ask the user before anything else.
- ; The "only parameter" requirement is needed, because when we show the user
- ; the UAC prompt, we restart the stub installer with the same parameters,
- ; plus a couple of extras related to elevation.
- ${If} $0 == "/Prompt"
- Call PromptForInstall
- Pop $0
- ${If} $0 != "yes"
- StrCpy $AbortInstallation "true"
- Quit
+ ClearErrors
+ ${GetOptions} "$0" "/UAC:" $1
+ ${If} ${Errors}
+ ClearErrors
+ ${GetOptions} "$0" "/Prompt" $1
+ ${IfNot} ${Errors}
+ Call PromptForInstall
+ Pop $0
+ ${If} $0 != "yes"
+ StrCpy $AbortInstallation "true"
+ Quit
+ ${EndIf}
${EndIf}
${EndIf}
Call CommonOnInit