Morantex
Posts: 16
Joined: Tue Jun 18, 2013 7:56 pm

Installing a file but AFTER any GAC registrations are done.

We have an unusual problem - we need to 'manually' copy a native DLL into a folder in the raw file system where a GAC component also resides.

The problem is that the installer's GAC registration seems to take place after all files have been copied to the target system, but when an assembly is registered into the GAC any existing version (which includes the raw file folder it sits in) is deleted.

FYI an assembly ASMBLY with version VERSION and public key token TOKEN gets placed into the GAC file system in a folder named: Windows\assembly\GAC_MSIL\ASMBLY\VERSION__TOKEN

This is hidden from view normally because Windows file explorer displays all this differently, but it is how its structured if you view the raw file system (eg this registry tweak lets you see it raw).

So my question: is there a way to defer a particular file copy step until AFTER any assemblies have been registered?

or

Is it possible to create a custom file copy step that gets performed at the end of the installation (but when it is still running in elevated mode).

?

Thanks
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Installing a file but AFTER any GAC registrations are do

Hello,

In order to achieve this you can add the related native DLL as a temporary file to your project. Then, you can develop your own custom action which will copy the temporary DLL file in the GAC. Also, the custom action should be added after "Install Execution Stage -> Add Resources" action group and should run as deferred with no impersonation.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”