OSDN Git Service

Ignore errors when unregistering the .nvda-addon file association, as it's probably...
authorJames Teh <jamie@jantrid.net>
Fri, 14 Sep 2012 01:40:05 +0000 (11:40 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 14 Sep 2012 01:40:05 +0000 (11:40 +1000)
source/installer.py

index 1159d9d..86d8bc7 100644 (file)
@@ -235,11 +235,11 @@ def unregisterAddonFileAssociation():
        try:\r
                # As per MSDN recomendation, we only need to remove the prog ID.\r
                _deleteKeyAndSubkeys(_winreg.HKEY_LOCAL_MACHINE, "Software\\Classes\\%s" % addonHandler.NVDA_ADDON_PROG_ID)\r
-               # Notify the shell that a file association has changed:\r
-               shellapi.SHChangeNotify(shellapi.SHCNE_ASSOCCHANGED, shellapi.SHCNF_IDLIST, None, None)\r
        except WindowsError:\r
-               log.error("Error removing addon file association.", exc_info=True)\r
-\r
+               # This is probably the first install, so just ignore the error.\r
+               return\r
+       # Notify the shell that a file association has changed:\r
+       shellapi.SHChangeNotify(shellapi.SHCNE_ASSOCCHANGED, shellapi.SHCNF_IDLIST, None, None)\r
 \r
 # Windows API call regDeleteTree is only available on vist and above so rule our own.\r
 def _deleteKeyAndSubkeys(key, subkey):\r