UAC, Windows Vista & VS 2005

UAC, Windows Vista & VS 2005

  • Comments 7

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

  • Here's a wishlist item for Orcas: there should be better tool support for Regfree COM when developing unmanaged apps.  

    1) Easy regfree COM generation
    2) Generating and keeping it up to date when making changes to ATL objects

    To me it's still a mystery how to get a tool to generate the necessary manifest text to put in your manifest for regfree COM.  I've fooled around with MSI and still can't get it right. What's the best way to do regfree COM?
  • Thanks for your comment.In Visual Studio 2005, there is a new feature that you can set the property "Isolated" to "true" for COM component to generate RegFree COM component. For more detail, you can reference this article: http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/
  • #includ.<iostream.h>
    int man ()
    {
    int  num1 , num2 , num3 , av ;
    cout<<"Enter the first number ">>;
    cin>> num1;
    cout<<"Enter the socoand number";
    cin>>num2;
    cout<<"Enter the therd number";
    cin>>num3;
    av=num1+num2+num3
    cuot<<"av=";
    return0;
    }
  • PingBack from http://www.midniteblog.com/2007/04/18/writing-an-outlook-add-in-with-c-epilogue/

  • Reg-Free COM isn't an option for me because my DLL is accessed as a control from a browser environment.  Exactly how would one modify the RGS file to avoid issues with UAC?  Is changing the "HKCR" at the top to "HRCU" all that's needed?

  • I have an appplication that adds an entry to a context menu and launches an exe when the the corresponding action is clicked.

    This is working fine when UAC is turned off but not when it is turned on...

    The code for this is written in a dLL in c#. what should i do?

  • I have a post build action which installs the output dll to the global assembly cache using the gacuitl.exe command.

    My component is working fine when I compile it in administrator user.

    But it is not working for myuser[ myuser was in administrator's group].

    Also I set "Register for cominterop" option in project properties [VS.NET 2005 C# Project].

    While launching the application it shows the following error "Interface not registered"

    All the problems in Windows Vista.

    Shell I do anything special for vista?

Page 1 of 1 (7 items)