Reputation: 14622
I have an installer (made with Advanced Installer). I have an application that has to interact with it, but I don't know how to find the MSIHANDLE of that installation. I looked in the Microsoft Reference but I haven't found anything helpful for my problem.
Any help please?
Upvotes: 0
Views: 1391
Reputation: 55601
The MSI handle is not available to out of process code. You'd need to write a custom action that could host some type of RPC mechanism that your application could then interact with. This is basically how Windows Installer XML's (Wix) Deployment Tools Foundation (DTF) works. It allows you to write custom actions using C# that gets wrapped with a C++ host. The C++ host uses RunDLL32 to execute the managed code out of process ( so that it doesn't tattoo the msiexec process with a CLR version ) and then an IPC tunnel is created between the two.
In your C# there is an interop library that marshalls calls across the IPC tunnel where the C++ code then calls the MSI API and returns the results.
Upvotes: 1