Browse Source

find windows path

master
David Beltra 1 year ago
parent
commit
bfd3ea3b9a
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      platform_Windows.py

+ 12
- 0
platform_Windows.py View File

@ -1,3 +1,15 @@
# coding=UTF-8
import os
from _winreg import OpenKey, HKEY_LOCAL_MACHINE, QueryValueEx
path = r"Software\Clients\Mail\Mozilla Thunderbird\InstallInfo"
with OpenKey(HKEY_LOCAL_MACHINE, path) as key:
keyval = QueryValueEx(key, "ReinstallCommand")
regstring = keyval[0]
path_start = regstring.find('\"')
path_end = regstring.find('\"', path_start+1)
path = regstring[path_start+1:path_end]
uninstall_path = os.path.split(path)[0]
thunderbird_base = os.path.dirname(uninstall_path)

Loading…
Cancel
Save