
Originally Posted by
squidge
Check the Microsoft requirements on MSDN. Eg for Windows 7:
"All application data that must be shared among users on the computer should be stored within ProgramData. All application data exclusive to a specific user and not to be shared with other users of the computer must be stored in Users\<username>\AppData."
As for where the directories are, check out
QDesktopServices::storageLocation
Thanks.
But QDesktopServices::storageLocation doesn't support "all users\appdata", but only for current user.
For example:
ini_path = QDesktopServices::storageLocation(QDesktopServices :
ataLocation);
gives "<username>\local settings\AppData".
PS:
ini_path = getenv("ProgramData"); // "<username>\AppData".
ini_path = getenv("ALLUSERSPROFILE"); // "all users\".
But I need exactly "all users\appdata".
Added after 1 2 minutes:
I found the solution:
QSettings register("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
QSettings::NativeFormat);
QString allUserDesktop
( register.
value("Common AppData").
toString());
QSettings register("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", QSettings::NativeFormat);
QString allUserDesktop( register.value("Common AppData").toString());
To copy to clipboard, switch view to plain text mode
Bookmarks