Bug 843248 - Upgrading with maintenance service from a non metro build to a metro build does not show tile. r=jimm
authorBrian R. Bondy <netzen@gmail.com>
Wed, 20 Feb 2013 19:53:39 -0500
changeset 122426 d57a813c77a48307fa76532884dcc8a91aef79ea
parent 122425 461e427960b2ca60f887de793f10fb546bbc3a9a
child 122527 702d2814efbf33eea652d5bfcc658aba75331014
child 122575 b01c5df0626900abb1ba995f606d4faead5cf6da
push id24341
push userbbondy@mozilla.com
push dateThu, 21 Feb 2013 00:54:07 +0000
treeherdermozilla-central@d57a813c77a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs843248
milestone22.0a1
first release with
nightly linux32
d57a813c77a4 / 22.0a1 / 20130221030952 / files
nightly linux64
d57a813c77a4 / 22.0a1 / 20130221030952 / files
nightly mac
d57a813c77a4 / 22.0a1 / 20130221030952 / files
nightly win32
d57a813c77a4 / 22.0a1 / 20130221030952 / files
nightly win64
d57a813c77a4 / 22.0a1 / 20130221030952 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 843248 - Upgrading with maintenance service from a non metro build to a metro build does not show tile. r=jimm
browser/installer/windows/nsis/shared.nsh
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -45,18 +45,29 @@ FunctionEnd
   ${If} $0 == "FirefoxURL"
     ReadRegStr $0 HKCU "Software\Classes\FirefoxURL\shell\open\command" ""
     ${GetPathFromString} "$0" $0
     ${GetParent} "$0" $0
     ${If} ${FileExists} "$0"
       ${GetLongPath} "$0" $0
     ${EndIf}
     ${If} "$0" == "$INSTDIR"
-      ; Win8 specific registration
-      Call RegisterStartMenuTile
+
+      ; PostUpdate is called from both session 0 and from the user session
+      ; for service updates, make sure that we only register with the user session
+      ; Otherwise ApplicationID::Set can fail intermittently with a file in use error.
+      System::Call "kernel32::GetCurrentProcessId() i.r0"
+      System::Call "kernel32::ProcessIdToSessionId(i $0, *i ${NSIS_MAX_STRLEN} r9)"
+      
+      ${If} $9 != 0 ; We're not running in session 0
+        ; Win8 specific registration
+        Call RegisterStartMenuTile
+      ${EndIf}
+
+
     ${EndIf}
   ${EndIf}
 
   ${CreateShortcutsLog}
 
   ; Remove registry entries for non-existent apps and for apps that point to our
   ; install location in the Software\Mozilla key and uninstall registry entries
   ; that point to our install location for both HKCU and HKLM.
@@ -187,16 +198,17 @@ FunctionEnd
       nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
     ${EndIf}
   ${EndIf}
 !endif
 
 ; Register the DEH
 !ifdef MOZ_METRO
   ${If} ${AtLeastWin8}
+  ${AndIf} $9 != 0 ; We're not running in session 0
     ; If RegisterCEH is called too close to changing the shortcut AppUserModelID
     ; and if the tile image is not already in cache.  Then Windows won't refresh
     ; the tile image on the start screen.  So wait before calling RegisterCEH.
     ; We only need to do this when the DEH doesn't already exist.
     ReadRegStr $0 HKCU "Software\Classes\FirefoxURL\shell\open\command" "DelegateExecute"
     ${If} $0 != ${DELEGATE_EXECUTE_HANDLER_ID}
       Sleep 3000
     ${EndIf}