Bug 981166 - Update installer related logic pertaining to the metro browser. r=rstrong, a=relman
authorJim Mathies <jmathies@mozilla.com>
Mon, 10 Mar 2014 12:23:54 -0500
changeset 176461 b528a01a01f4bcbcaba366c7da9ed096c219fd9f
parent 176460 da6dfbd38223b34f40fef253fd6fdef3df09f206
child 176462 c6c843644fbf436929dae282ee7d44342c359a61
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong, relman
bugs981166
milestone28.0
Bug 981166 - Update installer related logic pertaining to the metro browser. r=rstrong, a=relman
browser/installer/windows/nsis/installer.nsi
browser/installer/windows/nsis/shared.nsh
browser/installer/windows/nsis/uninstaller.nsi
toolkit/mozapps/installer/windows/nsis/common.nsh
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -381,16 +381,24 @@ Section "-Application" APP_IDX
     ${CleanupMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \
                                         "FirefoxURL" \
                                         "FirefoxHTML"
     ${AddMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \
                                     "$INSTDIR\CommandExecuteHandler.exe" \
                                     $AppUserModelID \
                                     "FirefoxURL" \
                                     "FirefoxHTML"
+!else
+  ; The metro browser is not enabled by mozconfig.
+  ${If} ${AtLeastWin8}
+    ${RemoveDEHRegistration} ${DELEGATE_EXECUTE_HANDLER_ID} \
+                             $AppUserModelID \
+                             "FirefoxURL" \
+                             "FirefoxHTML"
+  ${EndIf}
 !endif
   ${EndIf}
 
 !ifdef MOZ_MAINTENANCE_SERVICE
   ; If the maintenance service page was displayed then a value was already 
   ; explicitly selected for installing the maintenance service and 
   ; and so InstallMaintenanceService will already be 0 or 1.
   ; If the maintenance service page was not displayed then 
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -211,16 +211,24 @@ FunctionEnd
     ; 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}
     Call RegisterCEH
   ${EndIf}
+!else
+  ; The metro browser is not enabled by mozconfig.
+  ${If} ${AtLeastWin8}
+    ${RemoveDEHRegistration} ${DELEGATE_EXECUTE_HANDLER_ID} \
+                             $AppUserModelID \
+                             "FirefoxURL" \
+                             "FirefoxHTML"
+  ${EndIf}
 !endif
 !macroend
 !define PostUpdate "!insertmacro PostUpdate"
 
 !macro SetAsDefaultAppGlobal
   ${RemoveDeprecatedKeys} ; Does not use SHCTX
 
   SetShellVarContext all      ; Set SHCTX to all users (e.g. HKLM)
--- a/browser/installer/windows/nsis/uninstaller.nsi
+++ b/browser/installer/windows/nsis/uninstaller.nsi
@@ -295,16 +295,24 @@ Section "Uninstall"
 !ifdef MOZ_METRO
   ${If} ${AtLeastWin8}
     ${un.CleanupMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \
                                            "FirefoxURL" \
                                            "FirefoxHTML"
   ${EndIf}
   ${ResetWin8PromptKeys}
   ${ResetWin8MetroSplash}
+!else
+  ; The metro browser is not enabled by mozconfig.
+  ${If} ${AtLeastWin8}
+    ${RemoveDEHRegistration} ${DELEGATE_EXECUTE_HANDLER_ID} \
+                             $AppUserModelID \
+                             "FirefoxURL" \
+                             "FirefoxHTML"
+  ${EndIf}
 !endif
 
   ${un.RegCleanAppHandler} "FirefoxURL"
   ${un.RegCleanAppHandler} "FirefoxHTML"
   ${un.RegCleanProtocolHandler} "ftp"
   ${un.RegCleanProtocolHandler} "http"
   ${un.RegCleanProtocolHandler} "https"
 
--- a/toolkit/mozapps/installer/windows/nsis/common.nsh
+++ b/toolkit/mozapps/installer/windows/nsis/common.nsh
@@ -7688,17 +7688,17 @@
   System::Int64Op $0 / 1000
   Pop $0
 
   Pop $1
   Exch $0 ; return elapsed seconds
 !macroend
 
 !ifdef MOZ_METRO
-; Removes the CEH registration if it's set to our installation directory.
+; Removes the DEH registration if it's set to our installation directory.
 ; If it's set to some other installation directory, then it should be removed
 ; by that installation.
 !macro RemoveDEHRegistrationIfMatchingCall un
 
   Function ${un}RemoveDEHRegistrationIfMatchingCall
     ; Retrieve DEH ID from the stack into $R9
     Exch $R9
     Exch 1
@@ -7812,8 +7812,70 @@
   ; Win8 Metro delegate execute handler registration
   WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" "" "$BrandShortName CommandExecuteHandler"
   WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" "AppId" "${DELEGATE_EXECUTE_HANDLER_ID}"
   WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}\LocalServer32" "" "${DELEGATE_EXECUTE_HANDLER_PATH}"
 !macroend
 !define AddMetroBrowserHandlerValues "!insertmacro AddMetroBrowserHandlerValues"
 !endif ;end MOZ_METRO
 
+; Unconditionally removes the delegate execute handler registration used to
+; launch the metro browser and misc. metro related registry values.
+!macro RemoveDEHRegistration DELEGATE_EXECUTE_HANDLER_ID \
+                             APP_USER_MODEL_ID \
+                             PROTOCOL_ACTIVATION_ID \
+                             FILE_ACTIVATION_ID
+  ; Remove the app user model id root registration used by widget for tray redistration.
+  DeleteRegKey HKCU "Software\Classes\${APP_USER_MODEL_ID}"
+  DeleteRegKey HKLM "Software\Classes\${APP_USER_MODEL_ID}"
+
+  ; Remove metro browser splash image data
+  DeleteRegKey HKCU "Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\DefaultBrowser_NOPUBLISHERID\SplashScreen\DefaultBrowser_NOPUBLISHERID!${APP_USER_MODEL_ID}"
+
+  ; Misc. metro keys
+  DeleteRegKey HKCU "Software\Mozilla\Firefox\Metro"
+  DeleteRegValue HKCU "Software\Mozilla\Firefox" "CEHDump"
+  DeleteRegValue HKCU "Software\Mozilla\Firefox" "MetroD3DAvailable"
+  DeleteRegValue HKCU "Software\Mozilla\Firefox" "MetroLastAEH"
+
+  ; Remove Application Accociation Toasts
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.htm"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.html"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.xht"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.xhtml"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxHTML_.shtml"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxURL_ftp"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxURL_http"
+  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" "FirefoxURL_https"
+
+  ; Remove delegate execute handler clsid registration
+  DeleteRegKey HKCU "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}"
+  DeleteRegKey HKLM "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}"
+
+  DeleteRegValue HKCU "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+  DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+  DeleteRegValue HKCU "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+  DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+
+  ; Remove protocol and file delegate execute handler id assoc
+  DeleteRegValue HKCU "Software\Classes\${PROTOCOL_ACTIVATION_ID}" "AppUserModelID"
+  DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}" "AppUserModelID"
+  DeleteRegValue HKCU "Software\Classes\${FILE_ACTIVATION_ID}" "AppUserModelID"
+  DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}" "AppUserModelID"
+
+  ; Remove delegate execute application registry keys
+  DeleteRegKey HKCU "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application"
+  DeleteRegKey HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application"
+  DeleteRegKey HKCU "Software\Classes\${FILE_ACTIVATION_ID}\Application"
+  DeleteRegKey HKLM "Software\Classes\${FILE_ACTIVATION_ID}\Application"
+
+  ; Remove misc. shell open info
+  DeleteRegValue HKCU "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open" "CommandId"
+  DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open" "CommandId"
+  DeleteRegValue HKCU "Software\Classes\${FILE_ACTIVATION_ID}\shell\open" "CommandId"
+  DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}\shell\open" "CommandId"
+  DeleteRegValue HKCU "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+  DeleteRegValue HKLM "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+  DeleteRegValue HKCU "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+  DeleteRegValue HKLM "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute"
+!macroend
+!define RemoveDEHRegistration "!insertmacro RemoveDEHRegistration"
+!define un.RemoveDEHRegistration "!insertmacro RemoveDEHRegistration"