From my admin installer I call SHGetKnownFolderPath(FOLDERID_LocalAppData)
because I want to install to LocalAppData (I need write access to the installation directory).
This is ok when the current user is an administrator, the user gets the UAC prompt and proceeds.
However, if the current user is not an administrator, the user gets the UAC prompt, fills username+password and then this function returns the admin account's LocalAppData, not the current users'.
How can I get the current user's folder at all times?
Or, how to check if the current user was not an admin (so it had to enter credentials) so to suggest another installation location?