Bug 1336243 - Fix a regression from bug 1324617 in launching the browser post-install. r?rstrong draft
authorMatt Howell <mhowell@mozilla.com>
Thu, 02 Feb 2017 16:24:55 -0800
changeset 469937 3959a2f6b995c02a8584472a04c50c529bccbc6a
parent 469700 fc352d66e7bce2a4d8635c1b8a815b62616420b5
child 544341 421df13188ef5bc96754c376b406c98bf1a0572a
push id43885
push usermhowell@mozilla.com
push dateFri, 03 Feb 2017 00:25:28 +0000
reviewersrstrong
bugs1336243, 1324617
milestone54.0a1
Bug 1336243 - Fix a regression from bug 1324617 in launching the browser post-install. r?rstrong Bug 1324617 changed the name of the registry path that was being used to find the new installation to launch, but forgot to update that function. This patch switches to a more direct method of getting the right path to launch. MozReview-Commit-ID: Hexhj9y4ixc
browser/installer/windows/nsis/installer.nsi
browser/installer/windows/nsis/stub.nsi
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -827,27 +827,24 @@ Function LaunchApp
 !endif
 
   ClearErrors
   ${GetParameters} $0
   ${GetOptions} "$0" "/UAC:" $1
   ${If} ${Errors}
     Exec "$\"$INSTDIR\${FileMainEXE}$\""
   ${Else}
+    UAC::StackPush "$INSTDIR\${FileMainEXE}"
     GetFunctionAddress $0 LaunchAppFromElevatedProcess
     UAC::ExecCodeSegment $0
   ${EndIf}
 FunctionEnd
 
 Function LaunchAppFromElevatedProcess
-  ; Find the installation directory when launching using GetFunctionAddress
-  ; from an elevated installer since $INSTDIR will not be set in this installer
-  ${StrFilter} "${FileMainEXE}" "+" "" "" $R9
-  ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
-  ${GetPathFromString} "$0" $0
+  Pop $0
   ${GetParent} "$0" $1
   ; Set our current working directory to the application's install directory
   ; otherwise the 7-Zip temp directory will be in use and won't be deleted.
   SetOutPath "$1"
   Exec "$\"$0$\""
 FunctionEnd
 
 ################################################################################
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -2054,27 +2054,24 @@ Function LaunchApp
   ; Set the current working directory to the installation directory
   SetOutPath "$INSTDIR"
   ClearErrors
   ${GetParameters} $0
   ${GetOptions} "$0" "/UAC:" $1
   ${If} ${Errors}
     Exec "$\"$INSTDIR\${FileMainEXE}$\""
   ${Else}
+    UAC::StackPush "$INSTDIR\${FileMainEXE}"
     GetFunctionAddress $0 LaunchAppFromElevatedProcess
     UAC::ExecCodeSegment $0
   ${EndIf}
 FunctionEnd
 
 Function LaunchAppFromElevatedProcess
-  ; Find the installation directory when launching using GetFunctionAddress
-  ; from an elevated installer since $INSTDIR will not be set in this installer
-  ${StrFilter} "${FileMainEXE}" "+" "" "" $R9
-  ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
-  ${GetPathFromString} "$0" $0
+  Pop $0
   ; Set the current working directory to the installation directory
   ${GetParent} "$0" $1
   SetOutPath "$1"
   Exec "$\"$0$\""
 FunctionEnd
 
 Function CopyPostSigningData
   ${LineRead} "$EXEDIR\postSigningData" "1" $PostSigningData