Skip to content

Commit

Permalink
Better way to determine SDK directory in Windows.
Browse files Browse the repository at this point in the history
Using the disk letter of the `AppData` directory to determine the other possible paths to TideSDK. I kept the existing directories for backwards compatibility.
  • Loading branch information
rjkip committed Dec 1, 2012
1 parent 8f0a861 commit f24704b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sdk/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ def init_normal_dirs(self, script_dir):
'/Library/Application Support/TideSDK'
]
elif (self.target_os == 'win32'):
appdata = os.environ['APPDATA']
drive = appdata[0]
self.install_dirs = [
p.join(os.environ['APPDATA'], 'TideSDK'),
# TODO: Is there a better way to determine this directory?
p.join(appdata, 'TideSDK'),
drive + ':\\ProgramData\\TideSDK',
drive + ':\\Documents and Settings\\All Users\\Application Data\\TideSDK',
'C:\\ProgramData\\TideSDK',
'C:\\Documents and Settings\All Users\Application Data\TideSDK'
'C:\\Documents and Settings\\All Users\\Application Data\\TideSDK'
]
else:
raise Exception("Unknown environment!")
Expand Down

0 comments on commit f24704b

Please sign in to comment.