Bug 793461 - Uninstalling metro browser now removes appusermodelid reg keys. r=jimm
authorBrian R. Bondy <netzen@gmail.com>
Sat, 22 Sep 2012 21:52:50 -0400
changeset 108048 955415a397bfa3af9430a91544992682efb3c424
parent 108047 4a2cd2911c281f4f10fd9f6bfaeed825ef1ae5fe
child 108049 fe5b75aa2b167af467f2a05d0c807545030a5c19
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersjimm
bugs793461
milestone18.0a1
Bug 793461 - Uninstalling metro browser now removes appusermodelid reg keys. r=jimm
toolkit/mozapps/installer/windows/nsis/common.nsh
--- a/toolkit/mozapps/installer/windows/nsis/common.nsh
+++ b/toolkit/mozapps/installer/windows/nsis/common.nsh
@@ -6966,44 +6966,44 @@
 !macro RemoveDEHRegistrationIfMatchingCall un
   Function ${un}RemoveDEHRegistrationIfMatchingCall
     ; Move the old $R0 on the stack and set it to DEH ID
     Exch $R0
     ; Backup the old values of R8 and R7 on the stack
     Push $R8
     Push $R7
 
+    ; Conditionally remove the DEH as long as we are the default (HKCU)
     ReadRegStr $R8 HKCU "Software\Classes\CLSID\$R0\LocalServer32" ""
     ${${un}GetLongPath} "$INSTDIR" $R7
     StrCmp "$R8" "" next +1
     IfFileExists "$R8" +1 clearHKCU
     ${${un}GetParent} "$R8" $R8
     ${${un}GetLongPath} "$R8" $R8
     StrCmp "$R7" "$R8" clearHKCU next
     clearHKCU:
     DeleteRegKey HKCU "Software\Classes\CLSID\$R0"
-    DeleteRegValue HKCU \
-                   "Software\Classes\$AppUserModelID\.exe\shell\open\command" \
-                   "DelegateExecute"
     next:
 
+    ; Conditionally remove the DEH as long as we are the default (HKLM)
     ReadRegStr $R8 HKLM "Software\Classes\CLSID\$R0\LocalServer32" ""
     ${${un}GetLongPath} "$INSTDIR" $R7
     StrCmp "$R8" "" done +1
     IfFileExists "$R8" +1 clearHKLM
     ${${un}GetParent} "$R8" $R8
     ${${un}GetLongPath} "$R8" $R8
     StrCmp "$R7" "$R8" clearHKLM done
     clearHKLM:
     DeleteRegKey HKLM "Software\Classes\CLSID\$R0"
-    DeleteRegValue HKLM \
-                   "Software\Classes\$AppUserModelID\.exe\shell\open\command" \
-                   "DelegateExecute"
     done:
 
+    ; Always remove the AppUserModelID keys for this installation
+    DeleteRegKey HKCU "Software\Classes\$AppUserModelID"
+    DeleteRegKey HKLM "Software\Classes\$AppUserModelID"
+
     ; Restore the stack back to its original state
     Pop $R7
     Pop $R8
     Pop $R0
   FunctionEnd
 !macroend
 
 !macro RemoveDEHRegistrationIfMatching