Bug 737833 - Add support for clearing out orphaned entries. r=rstrong
authorBrian R. Bondy <netzen@gmail.com>
Mon, 17 Sep 2012 15:22:33 -0400
changeset 107785 b7b2e59c623775bca01e96276801da72a783a040
parent 107784 d212c1a845e2014ebe76b40d9172d9f554c9f747
child 107786 4b9af52437cfb3a8d004db7a50abbca9b48f5092
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersrstrong
bugs737833
milestone18.0a1
Bug 737833 - Add support for clearing out orphaned entries. r=rstrong
toolkit/mozapps/installer/windows/nsis/common.nsh
--- a/toolkit/mozapps/installer/windows/nsis/common.nsh
+++ b/toolkit/mozapps/installer/windows/nsis/common.nsh
@@ -6964,31 +6964,35 @@
     Exch $R0
     ; Backup the old values of R8 and R7 on the stack
     Push $R8
     Push $R7
 
     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" +1 next
+    StrCmp "$R7" "$R8" clearHKCU next
+    clearHKCU:
     DeleteRegKey HKCU "Software\Classes\CLSID\$R0"
     DeleteRegValue HKCU \
                    "Software\Classes\$AppUserModelID\.exe\shell\open\command" \
                    "DelegateExecute"
     next:
 
     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" +1 done 
+    StrCmp "$R7" "$R8" clearHKLM done
+    clearHKLM:
     DeleteRegKey HKLM "Software\Classes\CLSID\$R0"
     DeleteRegValue HKLM \
                    "Software\Classes\$AppUserModelID\.exe\shell\open\command" \
                    "DelegateExecute"
     done:
 
     ; Restore the stack back to its original state
     Pop $R7