-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locate user's profile directory on windows #140
Comments
From sl1200mk2 on May 23, 2011 00:10:25 there are several way to retrieve environment variable on windows: it depends of wich varaiable we need. ++ |
From si...@nomis52.net on May 23, 2011 08:10:14 We only need to fetch a single variable at a time so ExpandEnvironmentStrings() is the most appropriate here. |
From sl1200mk2 on May 25, 2011 06:59:50 from all i saw, major issue with ExpandEnvironmentStrings() is this function needs WCHAR as parameter. |
From si...@nomis52.net on May 25, 2011 08:32:21 Ok, after reading http://www.codeproject.com/Tips/76252/What-are-TCHAR-WCHAR-LPSTR-LPWSTR-LPCTSTR-etc.aspx and coming up to speed on win32 string handling, it looks like it'll only require a LPCWSTR is unicode is on. Is unicode on when we compile? How can we check and/or turn it off? I think this should work if unicode is off const string key = "foo" // this would be the argument to the function we're writing |
From sl1200mk2 on June 06, 2011 06:39:14 unicode is off unless you set to 1 _UNICODE and UNICODE macro this is coming from curl and should work as we do not turn on unicode, variable should be "%ProgramFiles%" char env[MAX_PATH]; /* MAX_PATH is from windef.h */ but maybe this is too much c style... |
From si...@nomis52.net on June 06, 2011 08:13:37 Let's start with that and then I can provide comments on C++ style. |
From sl1200mk2 on June 06, 2011 08:28:27 maybe it will be an issue for the future if we don't use wchar_t on windows ? |
From si...@nomis52.net on June 06, 2011 08:33:40 We'll ignore unicode for now and just go with what you have above. |
From sl1200mk2 on June 06, 2011 08:40:11 ok Simon |
olad preferences are now stored in %LOCALAPPDATA%/.ola/. This is handled in OlaDaemon::DefaultConfigDir() by using SHGetFolderPath with CSIDL_LOCAL_APPDATA . |
From si...@nomis52.net on May 22, 2011 09:30:50
On *nix we use getpwuid_r() to locate the user's home dir. Under Windows we can read the %UserProfile% environment variable.
We should add a function
string GetEnvVariable(const string &variable)
to the common utils and use this to read the env var.
Original issue: http://code.google.com/p/open-lighting/issues/detail?id=139
The text was updated successfully, but these errors were encountered: