regasm Vist/Win7 UAC problem - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

vugenti
Posts: 2
Joined: Tue Jul 06, 2010 6:33 pm

regasm Vist/Win7 UAC problem

Summary: (see below for details of my AI configuration)

I have a .NET assembly that implements a COM LocalServer32 Interop wrapper exposing a custom COM Interface. The interface is consumed by a VC++ unmanaged in-process COM server using early binding to the typelib.

As documented elsewhere, I have configured my setup to utilize a Search Behavior and Custom Action to perform registration of a .NET ComInterop DLL with the /tlb argument to generate and register typelib information.

Everything works fine on Windows XP and the interface can be accessed fine by my VC++ (non-managed) COM client using early binding after the installation completes.

On Windows Vista / Windows 7, the execution of regasm.exe fails and the typelib is not registered. I can run a command prompt as Administrator and run regasm /tlb manually, then it will work fine.

I believe the problem is caused by UAC restrictions but cannot understand why because I have modified the installer package to run only as Administrator and observed the UAC elevation prompt during installation - but the call to regasm still fails. Coincidentally, I also have the unmanaged COM DLL set to Auto register file and it is working fine.

Configuration Details:
* Install Parameters - Installation Options - Installation Type = Per-machine only (fail if user is not Administrator)
* Custom Behavior - Search item "REGASM_20_PATH" = [WindowsFolder]Microsoft.NET\Framework\v2.0.50727
* Custom Behavior - Custom Actions - InstallExecuteSequence -> Install -> PropertySource
Property Name: REGASM_20_PATH
Source type: Executable (*.exe)
Command Line: "[MyCOMFile.exe]" /tlb
Synchronous execution, check return code
Immediate Execution
Always Execute


I suspect the placement of the custom behavior is preventing the elevated token to be used while executing regasm.
vugenti
Posts: 2
Joined: Tue Jul 06, 2010 6:33 pm

Re: regasm Vist/Win7 UAC problem

Found the answer here: http://www.advancedinstaller.com/user-guide/faq-ca.html
Why does my custom action fail on Vista and above?
On Windows Vista and above a custom action which needs Administrator privileges should be set to run without impersonation, usually "Deferred with no impersonation". This way it will run under the local system account with full privileges. You can read more about custom action execution options in the Custom Action Properties article.

Return to “Common Problems”