Archive for the ‘Setup’ Category

Working on new Neutron installer (which is not MSI based due to some troubles related to Vista UAC system) I had to install the assembly into the GAC without using gacutil.exe. I mean programmatically.

I googled some blog posts on this subject. The first article proposed to use Windows Installer. From my point of view it is too complicated. After that I read about programmatic modifying the GAC with the Fusion APIs (C++ example and managed one). Smells like a hack. Rejected as well.

And then I found the awesome post which describes a really good solution of my problem: you can use System.EnterpriseServices.Internal.Publish class to install your assembly into the GAC and uninstal it back!

You just need to write a line of code:

new System.EnterpriseServices.Internal.Publish().GacInstall(”myassembly.dll”);




Read Full Post »