I\'m using SHGetFolderPath CSIDL_APPDATA to get path to the application data folder under current user account. It works fine, but if it is called from an installer, Windows
SHGetFolderPath() has an hToken
parameter for this exact situation. If hToken
is NULL, the function uses the access token associated with the calling thread. Otherwise it can be set to an access token for another user account.
If the installer is running elevated as an admin, the installer will have to either:
impersonate the desired user account before calling SHGetFolderPath()
.
obtain an access token for the desired user account and pass it to hToken
.