diff options
Diffstat (limited to 'wineconfig/wineread.py')
-rw-r--r-- | wineconfig/wineread.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/wineconfig/wineread.py b/wineconfig/wineread.py index d334d7c..3a051d8 100644 --- a/wineconfig/wineread.py +++ b/wineconfig/wineread.py @@ -23,7 +23,7 @@ import os # Assumes the fake windows is installed in ~/.wine default_winepath = os.environ['HOME'] + "/.wine" winepath = default_winepath -defaultwinfolderspath = "c:\\windows\\profiles\\" + os.environ['USER'] +defaultwinfolderspath = "c:\\users\\" + os.environ['USER'] # Where the dll's are default_winebuildpath = "/usr/lib/wine" @@ -113,7 +113,7 @@ empty_shelllinks = ([26,"Desktop","","","",""], [30,"My Video","","","",""]) folder_nonexistent = "This folder does not exist, please map it." -profilesdirectory = winepath + "/dosdevices/c:/windows/profiles/" + os.environ['USER'] +profilesdirectory = winepath + "/dosdevices/c:/users/" + os.environ['USER'] def GetEmptyShellLinks(): """ Returns a list of important windows folders """ @@ -159,7 +159,7 @@ def GetValue(key, value): if error != 0: return "" - file=open('.registryvalue.reg') + file=open('.registryvalue.reg', encoding='utf-16', mode='r') for line in file: if line and line[0] == '"' or line[0] == '@': @@ -188,7 +188,7 @@ def GetKeyValues(key): settings = {} - file=open('.registrykey.reg') + file=open('.registrykey.reg', encoding='utf-16', mode='r') keycount = 0 for line in file: @@ -210,7 +210,7 @@ def GetUserShellRegistry(): if error != 0: return {} - usershellfile=open('.registryshelluser.reg') + usershellfile=open('.registryshelluser.reg', encoding='utf-16', mode='r') usershellfilelines = usershellfile.readlines() usershellfile.close() os.remove(".registryshelluser.reg") @@ -221,7 +221,8 @@ def GetUserShellRegistry(): for usershellline in usershellfilelines: usershellline = usershellline.split('=') - settings[usershellline[0].strip('"')] = usershellline[1].strip('"\r\n') + if len(usershellline) == 2: + settings[usershellline[0].strip('"')] = usershellline[1].strip('"\r\n') return settings @@ -230,7 +231,7 @@ def GetShellRegistry(): if error != 0: return {} - shellfile=open('.registryshell.reg') + shellfile=open('.registryshell.reg', encoding='utf-16', mode='r') shellfilelines = shellfile.readlines() shellfile.close() os.remove(".registryshell.reg") @@ -241,7 +242,8 @@ def GetShellRegistry(): for shellline in shellfilelines: shellline = shellline.split('=') - settings[shellline[0].strip('"')] = shellline[1].strip('"\r\n') + if len(shellline) == 2: + settings[shellline[0].strip('"')] = shellline[1].strip('"\r\n') return settings @@ -314,7 +316,7 @@ def GetApps(): if error != 0: return [] - settingsfile=open('.registryapps.reg') + settingsfile=open('.registryapps.reg', encoding='utf-16', mode='r') settingsfilelines = settingsfile.readlines() settingsfile.close() os.remove('.registryapps.reg') @@ -537,7 +539,7 @@ def VerifyWineDrive(path = None): if not path: path = self.default_winepath - return os.path.exists(path + "/dosdevices/c:/windows/profiles/" + os.environ['USER']) and \ + return os.path.exists(path + "/dosdevices/c:/users/" + os.environ['USER']) and \ os.path.exists(path + "/dosdevices/c:/windows/system32") and \ os.path.exists(path + "/system.reg") and os.path.exists(path + "/userdef.reg") and \ os.path.exists(path + "/user.reg") |