Reputation: 5019
I am creating an installer which will use a .NET COM component for our Access application. When I installed the COM dll to INSTALLDIR, it is working fine. I leave it to WIX to do the COM registration by running heat to harvest both the dll and the tlb. But now we want to install the dll to GAC, and only the tlb file will be installed in the INSTALLDIR. Our target is that different versions of our SW (it is OK to install them on the same machine) can use the same COM version and after uninstalling one version of our SW, the others will still work(this can't be achieved when we install the dll into INSTALLDIR, am I right?. If my way is wrong, please correct me).
Here comes the problem: in order to install it into GAC, I guess I am supposed to add a Assembly=".net" to the dll file declaration. However, during the installation, I get this error: "A problem was encountered in error handler: Automation error The system cannot find the file specified." when I am calling one COM method (Access reference that we created) in the commit phase, i.e., after the COM is registered. Apparently my COM was not registered successfully. But I don't really know why this happens. As I mentioned, the only change I made was to add this Assembly=".net". Before that, the COM registration is OK and I was calling it successfully.
Any help would be appreciated. Thanks!
Upvotes: 0
Views: 390
Reputation: 6667
This will not work as the GAC is for .net based dll's and will not accept COM dll's. To see for yourself try and drop the dll into the folder C:\Windows\assembly, you will get an error saying it doesn't have an assembly manifest.
What you should do is keep the Component GUID the same for all versions of your installer for that particular COM dll. This way windows installer will keep note of which applications are using it and only un-install it once the last one is removed. I would also put that into it's own installation folder otherwise you will get an application installation folder left over when the first installed version is un-installed.
Another option is to separate it into it's own installer and use a bootstrapper to install them together.
Upvotes: 1