Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register assemblies to GAC using InstallShield

I have to register multiple assemblies to GAC using InstallSheild and also I need the assemblies to be copied on the INSTALLDIR also. What's the best way to do it? Also I need to call regasm.exe for an assembly; can I do this using InstallShield?

I really need a new 'component' for each assembly that has to be registered in GAC?

like image 832
Cornel Avatar asked Mar 26 '10 16:03

Cornel


1 Answers

This answer assumes you are using a Windows Installer project type.

1) Create a component for each DLL file, make it as the keyfile and set the destination folder to GlobalAssemblyCache. This instructs Windows Installer to use the MsiPublishAssemblies standard action which in turn makes calls into Fusion to register the assembly in the GAC. This is effectively what GACUTIL does for you. Remember: GACUTIL is not redistributable. If the assembly has companion files, add them as companion files to the same component.

2) If your assembly is ComVisible, create a component for each DLL, mark it as the keyfile and set the .NET ComInterop to true. This will cause the COM information to be extracted at build time, and tell Windows Installer to use the MsiPublishAssemblies standard action to write the information to the registry. Note: If you have custom user code in the registration section of the assembly this will not be captured. This is per MSDN that regasm /regfile does not execute this code path. You will have to manually enter this information into InstallShield's registry view for that component.

3) Yes, you can deploy a strong-named assembly both globally and/or privatly. Whether the private one will be seen or not depends on whether the assembly with the reference has UseSpecific set or not.

like image 162
Christopher Painter Avatar answered Sep 21 '22 21:09

Christopher Painter