def onUninstall():
path = os.path.join(config.getUserDefaultConfigPath(), ".dbInstall")
if os.path.exists(path):
#This is an update. Bail.
os.remove(path)
return
key = _winreg.OpenKeyEx(_winreg.HKEY_CURRENT_USER, "Environment", 0, _winreg.KEY_READ | _winreg.KEY_WRITE)
try:
value, typ = _winreg.QueryValueEx(key, "Path")
except:
return
if value is None or value == "":
return
dir = os.path.dirname(__file__)
if not isinstance(dir, unicode):
dir = dir.decode(sys.getfilesystemencoding())
dir = dir.replace(addonHandler.DELETEDIR_SUFFIX, "")
if value.find(dir) != -1:
value = value.replace(";" + dir, "")
value = value.replace(dir + ";", "")
value = value.replace(dir, "")
_winreg.SetValueEx(key, "Path", None, typ, value)
sendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, u"Environment")
installTasks.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录