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.
FOLLOW US
Get the latest news in Application Packaging