gvasko
Posts: 33
Joined: Mon Jun 07, 2010 7:11 pm

Add assemblies in a synchronized folder to the GAC

Dear Support,

Is there a way to add assemblies automatically to the GAC?
We have a folder that is synchronized to the file system, so new assemblies are included in the installer, but not in the GAC.
Adding manually new assemblies to the GAC is always a pain.

Thank you in advance,
Gabor Vasko
Eusebiu
Posts: 4933
Joined: Wed Nov 14, 2012 2:04 pm

Re: Add assemblies in a synchronized folder to the GAC

Hi Gabor,

Unfortunately, we don't have predefined support for this.

We'll consider your suggestion for adding this feature, but for the moment there are not immediate plans. Thank you for suggestion.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
gvasko
Posts: 33
Joined: Mon Jun 07, 2010 7:11 pm

Re: Add assemblies in a synchronized folder to the GAC

Thank you, I will check for updates then.
Gabor Vasko
Eusebiu
Posts: 4933
Joined: Wed Nov 14, 2012 2:04 pm

Re: Add assemblies in a synchronized folder to the GAC

You're welcome. Please let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AquaComm
Posts: 45
Joined: Wed May 06, 2020 3:25 am

Re: Add assemblies in a synchronized folder to the GAC

Has this been implemented yet?
Catalin
Posts: 6638
Joined: Wed Jun 13, 2018 7:49 am

Re: Add assemblies in a synchronized folder to the GAC

Hello,

I'm afraid not.

If possible, could you please give me some more details about what you'd like to achieve?

Perhaps this is something achievable in the latest versions.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AquaComm
Posts: 45
Joined: Wed May 06, 2020 3:25 am

Re: Add assemblies in a synchronized folder to the GAC

I have approx. 110 meg of dependent dll's in one of my solutions. The solution contains about 5 individual programs each referencing at least some of those dependent dll's. Each of these projects utilize their own auto-updater. I decided to create a separate project that installs all the dependent dll's into one with the goal of removing approx 50-75 meg from each of the individual projects. Bloatware I know but that's life. The dll's are installed into the GAC. In principal this appears to be working very well as some project's distribution files have reduced in size from 70-90 meg to just 10 meg. The installation of the dll's to the GAC takes a considerable amount of time which is most distracting so I may not persevere with this methodology.

The dll project has some drawbacks as adding dll's has proved an onerous manual task. Obviously the folder holding the dll's can be and is syncronised however the dll files need to be individually selected and manually added to the Assemblies section in AI. At present I just select the individual folders, select all the files contained therein and repeatedly select OK when AI tells me it's already included.

Two solutions I can think of to speed things up and possibly automate the process would be to add syncronised folders to the Assembles section or not to add the dll's to the GAC at all. The later option may be the best as the time taken by AI (and probably any other installer) to remove files from the GAC can be relatively large. At present AI tells the end user that 37 seconds remain when uninstalling them from the GAC whereas it takes about an additional half an hour on top of the 37 seconds. Installing to the GAC is slightly faster. This is NOT an AI induced problem of course.
Last time I looked, adding hint paths to where to find the dependent dll's was not as efficient as it could be but I haven't done that for several years. Having dll manufacturers include version information in the dll's file name would of course assist greatly however that is never going to happen :-(
Catalin
Posts: 6638
Joined: Wed Jun 13, 2018 7:49 am

Re: Add assemblies in a synchronized folder to the GAC

Hello,

First of all, thank you for your followup on this and for sharing your details with me.

I definitely understand your scenario and the struggle.

However, the good news is that we might have a solution here, through our PowerShell automation support. :)

Here's how I'm thinking to achieve this:

1. first of all, we create the AI com object in PowerShell

Code: Select all

$ai = new-object -comobject AdvancedInstaller
2. we then load our project

Code: Select all

$project = $ai.LoadProject("C:\Users\Catalin\Desktop\Your Application.aip")
3. we then retrieve all the files from the project. In my case, there are only DLLs just as in your case as well

Code: Select all

$files = $project.FilesComponent.Files
If we then run "$files" we can see that it returns an array of the two files in my case
Screenshot_139.png
Screenshot_139.png (70.25 KiB) Viewed 9802 times

4. we then create the "Assemblies" component to reflect the page from our project

Code: Select all

$assemblies = $project.AssembliesComponent
5. now, considering the files are stored in an array, we can use a foreach and add the files using the "NewAssembly" method

Code: Select all

foreach ($file in $files){$assemblies.NewAssembly($file)}
Screenshot_140.png
Screenshot_140.png (49.74 KiB) Viewed 9802 times
6. save the project

Code: Select all

$project.Save()
Upon opening the project, we can see that the DLLs were added in the "Assemblies" page.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AquaComm
Posts: 45
Joined: Wed May 06, 2020 3:25 am

Re: Add assemblies in a synchronized folder to the GAC

Thanks for this most comprehensive reply. I will look into this when time allows as it points me to a better understanding to automation of the whole process.
:D :)
Catalin
Posts: 6638
Joined: Wed Jun 13, 2018 7:49 am

Re: Add assemblies in a synchronized folder to the GAC

You are always welcome! :)

If you encounter any issues please let me know and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”