Accessing registry in VC++ app with standard UAC level (Vista/7)
Posted on 2011-04-29
An application I'm working on cannot even read a HKEY_CURRENT_USER key when accessing at a standard UAC level under Vista or Win7. It comes up with a file not found error. Yet when accessing as an administration user (though not at the administrative level), no problem which is strange, again as I don't access with administrative priviledges. It is a VC++ app and the manifest is set to 'asInvoker' plus the manifest is included with the file. The installation is done with InstallShield Express with specific permissions set for the registry to Everyone and no domain; just blank.
I accessed another HKEY_CURRENT_USER area of the registry and didn't get an error.
I also ran Microsoft's Application Compatibility Toolkit and it indicates the a virtual registry should be used. I find that strange as all registry accesses are to HKCU keys.
To make sure the manifest is working correctly I raised the required level in the manifest to that needing administrative priviledges and when I did that I couldn't debug as the debugger didn't have administrative priviledges. That way I know that the manifest is being properly linked into the application. I would also imagine that I shouldn't be having the problem I'm having as the application is accepted as a regular application.
What must I do to fix this problem so anyone with any security level can install and use this application?