Domanda

I'm building an installer for a solution I've developped. The output of one of my projects is a dll that needs to be registered. I'm generating a MSI with Visual Studio then modifying it with InstallShield. Within visual studio I've added a custom action that needs admin privileges to be executed and set the register property of the dll to vsdrpCOMSelfReg. When I run the msi without admin privileges a message is shown saying that an operation needs admin role and when I confirm and change user account the installation finishes without any error, however the dll is not beeing registered. Am I missing something? How to correctly register a dll? Any help would be very appreciated.

È stato utile?

Soluzione

SelfRegistration is not a Windows Installer best practice. The correct approach is to author the COM metadata into the MSI and allow MSI to copy the file and apply the registry data. In InstallShield you achieve this by creating a component for your DLL, marking the DLL as the Key File and then right click the file and select Extract COM. InstallShield will then simulate a registration and author that information into the correct tables. Build and test on a clean machine. No custom actions should be needed and the installer will correctly support rollback scenarios.

Altri suggerimenti

There's no reason to even create a custom action to do this, even if it is Visual Studio. Mark the file as vsdrfCOM and the class registration will be extracted at build time into the MSI's Class table. Even if you were to insist on self registration, you could mark it vsdrfComSelfReg and it would get registered from the SelfReg table in the MSI file. No custom action at all. Anyway, as Christopher said, it's not good practice to run the self registration at install time for many reasons, one of which is missing dependencies.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top