Unable to re-register strong-named assembly in GAC - 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!

Sandy
Posts: 15
Joined: Tue Jun 16, 2009 8:02 am

Unable to re-register strong-named assembly in GAC

Hello,

I have successfully built my first setup (using AI 7.0.1 Enterprise Version). I installed this first version 1.0 with no difficulty. I then created a major upgrade 2.0 (with a new Prodcut Code) and installed it over the existing version (Ver 1.0). This installation also, seemingly, went through without a hitch. However, when I launched my application my PC simply crashed and would reboot on its own. After the forced reboot, the application worked fine.

My setting for Reboot Prompts is "Prompt for reboot when required". I tried "Force Reboot after install" but it didn't work. In this case also, even after AI forced a reboot, the application crashed and the PC was rebooted. Only after that did it work.

This problem does not arise if I manually uninstall Ver 1.0 and then install Ver 2.0. It happens when I try to install Ver 2.0 when Ver 1.0 is already installed.

After a while, I figured out that one of the strong-named assemblies in the GAC was getting uninstalled (since the old version first uninstalls) but was not getting re-installed when installing the new version. Both installations use the same version of this assembly.

On one of the forum threads I came across a similar problem, the solution offered was to check the "Ensure that this file
overwrites any installed target file" option in the Version tab of the "Edit File" dialog. I have tried this but with no success.

I've taken the following steps to add the assembly:

(1) Created a temp Folder in Files and Folders called "GAC" and added the assembly to this folder.
(2) I have set the "Ensure that this file overwrites any installed target file" in the "Version" tab
(3) In the "Assemblies" page, I've added this assembly. For Destination, I've selected "Install in Global Assembly Cache"
and selected selected ".NET Assembly" as type

If I install the same assembly in the Application Folder in Program Files, it works! Unfortunately, I need the assembly to reside in GAC.

What is it that I am doing wrong? Looking forward to your assistance...

Thanks & Regards,

Sandy
Sandy
Posts: 15
Joined: Tue Jun 16, 2009 8:02 am

Re: Unable to re-register strong-named assembly in GAC

Hello,

I think I've solved the problem by moving "RemoveExistingProducts" after "InstallFinalize" in the "InstallExecuteSequence". This makes sure that the assembly is not removed by Windows Installer while uninstalling the older version.

This, unfortunately has led to another problem related to shortcuts.

I have added the version number to all shortcuts to the application. I have shortcuts located in the "SHORTCUTDIR", "DesktopFolder" and "QuickLaunch" with names such as MyApp Ver x.x. I have also used a custom name for the "Add/Remove Panel" ie MyApp Ver x.x.

After changing the installation sequence, I find that I have 2 sets of shortcuts ie. "MyApp Ver 1.0" and "MyApp Ver 2.0" appearing at all 3 locations. In the "Add/Remove Panel", I find "MyApp Ver 1.0" instead of "MyApp Ver 2.0".

I tried using the "File Delete" option provided by AI. I can't seem to get the desired effect probably because I'm not setting the options/conditions correctly.

Is there a solution to get around this or do I necessarily have to drop the Version number? The upgrade works well if I drop the version number. However, we have always included version numbers in our shortcuts and "Add/Remove Panel" when using our old installer and so would prefer not to drop it now.

Thanks & Regards,

Sandy
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Unable to re-register strong-named assembly in GAC

Hi Sandy,
I think I've solved the problem by moving "RemoveExistingProducts" after "InstallFinalize" in the "InstallExecuteSequence".
In the Upgrades page you can select the "Install new version first and then uninstall old version" option. It will do aproximately the same thing.
In the "Add/Remove Panel", I find "MyApp Ver 1.0" instead of "MyApp Ver 2.0".
I'm not sure why this happens. Can you please send us a verbose log of the upgrade process to support at advancedinstaller dot com so we can investigate it?
After changing the installation sequence, I find that I have 2 sets of shortcuts ie. "MyApp Ver 1.0" and "MyApp Ver 2.0" appearing at all 3 locations.
I tried using the "File Delete" option provided by AI. I can't seem to get the desired effect probably because I'm not setting the options/conditions correctly.
This is the correct approach. I'm not sure why it doesn't work for you. Can you please send us the .AIP you are using so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sandy
Posts: 15
Joined: Tue Jun 16, 2009 8:02 am

Re: Unable to re-register strong-named assembly in GAC

Hi Cosmin,

I though I would try the "Install new version first and then uninstall old version" option in the Upgrades page since you had mentioned that the effect was slightly different. Well, it worked and the problem of the old version appearing in the "Add/Remove Panel" was solved!

I also gave the "File Delete" option another try and, yes, my old shortcut links are no longer appearing.

Thanks, once again, for your prompt support.

Regards,

Sandy

Return to “Common Problems”