UAC, Windows Vista & VS 2005

Hi, my name is Li Shao. I am a Software Design Engineer in Test in Visual C++ team. In this post, I am going to briefly talk about Vista new security feature and how it is going to affect some of the VC scenarios.

User Account Control (UAC) is a security feature in Windows Vista. It enables the users to perform common tasks as non-administrators. This security enhancement can prevent malicious software from being installed and run by the attackers. You can learn more about UAC from these resources:

http://blogs.msdn.com/uac

http://www.microsoft.com/technet/windowsvista/evaluate/feat/uaprot.mspx#E1F

When running Visual Studio 2005 on Windows Vista with UAC on, however, you will have permission issues with regsvr32.exe, regasm.exe and vcdeploy.exe. As a result, you may find your ATL COM component fail to register if it registers into HKLM or your Web application fail to deploy. These issues are expected with UAC on. You can work around this in a number of ways. The first is to change how your component registers (away from the ATL default) by modifying the RGS file or by moving to reg-free COM. The second would be to run regsvr32.exe or regasm.exe or vcdeploy.exe manually from an elevated command prompt (right-click command prompt and “Run as administrator”). Alternatively, a third workaround would be by running Visual Studio 2005 in admin mode. To run as an admin, what you can do is to right click on Visual Studio 2005 icon, choose “Run as administrator” from the context menu.

Thanks,
Li Shao
VC++ Team