GAC Installation AND local file installation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

JaedenRuiner
Posts: 12
Joined: Thu Apr 01, 2010 4:12 am

GAC Installation AND local file installation

Hello,

First I will say thank you for the support you've given me in figuring out how to configure setups with AI. It is a lifesaver.
I am looking at a Merge Module that I've designed because a few of my Assemblies are used by pretty much all of my projects. However, a few of them are also used as part of Visual Studio, and thus I like to "Add" them to the .Net References list. Now in order to do this, the Folder containing my GAC dll's must be listed under the HKLM\Software\Microsoft\.NETFramework\AssemblyFolders Registry Key.
So, if I were to install the dll to C:\Program Files\My Company\Common\MyGACDll.Dll
In the Merge Module, I added the Registry Key to Create:
HKLM\Software\Microsoft\.NETFramework\AssemblyFolders\My Company\(Default) = "C:\Program files\My Company\Common"

Now, the next time Visual Studio is opened, and the Add Reference dialog is opened, under the .Net tab, my namespace will be visible.

However, in AI, what I did was added the file to the directory structure I wanted to install it as, and then added it to the Assemblies Section, setting it to install to the GAC. However, my installation projects that use this merge module do not install the actual DLL to anywhere BUT the GAC. So my Added registry setting is pretty much useless.

My Solution so far, and I could use some pointers:
I've got the dll added to two locations in the files and folders section:
[CommonFilesFolder]MyCompany
APPDIR

In the Assemblies Section, I added the APPDIR copy of the DLL into the GAC
I added the CommonFiles copy of the dll to a "Specific Location" which is the DIR added to the registry in my custom registry entries.

However, since this is a shared Assembly, I went to the organization section, which shows 3 components.
My_Assembly_dll - Project Main Component
My.Assembly.dll - Assembly Component to Specific Location
My.Assembly.dll_1 - Assembly Component to GAC

The question is, I want them to remain as they are so if one of my projects is uninstalled, it doesn't remove them until the last application is removed. I wanted to verify, should i set the condition for these three to be (Not Installed) And/Or should i set the "Shared DLL Reference Count" AND/OR
"Shared Amongst Packages" for any one of them or all three?

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: GAC Installation AND local file installation

Hi,

Unfortunately using multiple copies of the same DLL (like you are doing now) is the only solution. In improvement for your case would be this:
- move the assembly installed in the GAC somewhere where there isn't a conflict with another copy of the DLL (since it's installed in GAC, it doesn't matter in what folder you place it)
- move the assembly installed in specific location to the actual location you want (for example in "Application Folder")

This way one copy is installed in your application folder (or in any folder you want) and another one in GAC.
The question is, I want them to remain as they are so if one of my projects is uninstalled, it doesn't remove them until the last application is removed.
For this just make sure that the components use the same GUIDs and the same names in all projects which contain them. This way Windows Installer will handle reference counts automatically.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”