diff --git a/browser/installer/windows/nsis/installer.nsi b/browser/installer/windows/nsis/installer.nsi index bac4eb1ef6a8b..064b63902bf3c 100644 --- a/browser/installer/windows/nsis/installer.nsi +++ b/browser/installer/windows/nsis/installer.nsi @@ -295,6 +295,8 @@ Var InstallResult Var LaunchedNewApp +Var +PostSigningData ; By defining @@ -541,6 +543,9 @@ insertmacro CopyFilesFromDir ! insertmacro +CopyPostSigningData +! +insertmacro CreateRegKey ! insertmacro @@ -4980,6 +4985,104 @@ STATUS_CLEANUP " SetDetailsPrint none +; +Maybe +copy +the +post +- +signing +data +? +StrCpy +PostSigningData +" +" +{ +GetParameters +} +0 +ClearErrors +; +We +don +' +t +get +post +- +signing +data +from +the +MSI +. +{ +GetOptions +} +0 +" +/ +LaunchedFromMSI +" +1 +{ +If +} +{ +Errors +} +; +The +stub +will +handle +copying +the +data +if +it +ran +us +. +ClearErrors +{ +GetOptions +} +0 +" +/ +LaunchedFromStub +" +1 +{ +If +} +{ +Errors +} +; +We +' +re +being +run +standalone +copy +the +data +. +{ +CopyPostSigningData +} +Pop +PostSigningData +{ +EndIf +} +{ +EndIf +} { Unless } @@ -8144,6 +8247,94 @@ value { EndIf } +; +PostSigningData +should +only +be +empty +if +we +didn +' +t +try +to +copy +the +; +postSigningData +file +at +all +. +If +we +did +try +and +the +file +was +missing +; +or +empty +this +will +be +" +0 +" +and +for +consistency +with +the +stub +we +will +; +still +submit +it +. +{ +If +} +PostSigningData +! += +" +" +nsJSON +: +: +Quote +/ +always +PostSigningData +Pop +0 +nsJSON +: +: +Set +/ +tree +ping +" +Data +" +" +attribution +" +/ +value +0 +{ +EndIf +} nsJSON : : diff --git a/browser/installer/windows/nsis/stub.nsi b/browser/installer/windows/nsis/stub.nsi index 92366418199c4..ca5b4a5356672 100644 --- a/browser/installer/windows/nsis/stub.nsi +++ b/browser/installer/windows/nsis/stub.nsi @@ -1235,6 +1235,9 @@ nsh " ! insertmacro +CopyPostSigningData +! +insertmacro ElevateUAC ! insertmacro @@ -7492,8 +7495,11 @@ ExitCode ERR_SUCCESS } " -Call +{ CopyPostSigningData +} +Pop +PostSigningData Call LaunchApp FunctionEnd @@ -8231,62 +8237,6 @@ EndIf } FunctionEnd Function -CopyPostSigningData -{ -LineRead -} -" -EXEDIR -\ -postSigningData -" -" -1 -" -PostSigningData -{ -If -} -{ -Errors -} -ClearErrors -StrCpy -PostSigningData -" -0 -" -{ -Else -} -CreateDirectory -" -LOCALAPPDATA -\ -Mozilla -\ -Firefox -" -CopyFiles -/ -SILENT -" -EXEDIR -\ -postSigningData -" -" -LOCALAPPDATA -\ -Mozilla -\ -Firefox -" -{ -Endif -} -FunctionEnd -Function DisplayDownloadError WebBrowser : diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index 9d351c850d446..bd1c95dd243b8 100644 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -40198,6 +40198,199 @@ pop endif ! macroend +/ +* +* +* +Copy +the +post +- +signing +data +which +was +left +alongside +the +installer +* +by +the +self +- +extractor +stub +into +the +global +location +for +this +data +. +* +* +If +the +post +- +signing +data +file +doesn +' +t +exist +or +is +empty +" +0 +" +is +* +pushed +on +the +stack +and +nothing +is +copied +. +* +Otherwise +the +first +line +of +the +post +- +signing +data +( +including +newline +* +if +any +) +is +pushed +on +the +stack +. +* +/ +! +macro +CopyPostSigningData +! +ifndef +{ +_MOZFUNC_UN +} +CopyPostSigningData +! +verbose +push +! +verbose +{ +_MOZFUNC_VERBOSE +} +! +define +{ +_MOZFUNC_UN +} +CopyPostSigningData +" +Call +{ +_MOZFUNC_UN +} +CopyPostSigningData +" +Function +CopyPostSigningData +Push +0 +; +Stack +: +old +0 +{ +LineRead +} +" +EXEDIR +\ +postSigningData +" +" +1 +" +0 +{ +If +} +{ +Errors +} +ClearErrors +StrCpy +0 +" +0 +" +{ +Else +} +CreateDirectory +" +LOCALAPPDATA +\ +Mozilla +\ +Firefox +" +CopyFiles +/ +SILENT +" +EXEDIR +\ +postSigningData +" +" +LOCALAPPDATA +\ +Mozilla +\ +Firefox +" +{ +Endif +} +Exch +0 +; +Stack +: +postSigningData +FunctionEnd +! +verbose +pop +! +endif +! +macroend # # #