Previous version not getting uninstalled before new version installs - Advanced Installer Community
flycast
Posts: 24
Joined: Thu Jul 25, 2019 10:31 pm

Previous version not getting uninstalled before new version installs

I have read https://www.advancedinstaller.com/user- ... ml#version.

It says the following:
When building, saving or selecting another page, you will be asked to generate a new Product Code. Answer “Generate new” if you want the new package to automatically upgrade the previous version of the story, if found on the target computer. If you answer “Keep existing”, the two versions will be prevented from being installed simultaneously on the same computer.
In my case I need to keep the same GUID. If I understand this correctly the automatic uninstall will not work.

How do I make sure I have the old version with the same GUID uninstall before the new version is installed, preferably silently?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Previous version not getting uninstalled before new version installs

Hello,

As explained in our "Product Identification" article:
Also, it is important to note that two products with the same ProductCode can not be installed on the same computer. Windows Installer will prevent this with an error reading:

Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Programs and Features in the Control Panel.
Basically, your product is identified by the ProductCode property. If you try to install two packages having the same ProductCode, even if the packages are totally different, Windows will think that it is the same package and will return the above error.

This check is done exactly at the start of the installation and it will fail if it notices that another product having the same ProductCode is already installed.

With that being said, if you want your package to upgrade an older version of itself, the solution is to change its' ProductCode.
In my case I need to keep the same GUID.
Could you please elaborate a bit more on this? Why would you need to keep the same ProductCode between the two versions of your product?
If I understand this correctly the automatic uninstall will not work.
Indeed, you understood this correctly.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
flycast
Posts: 24
Joined: Thu Jul 25, 2019 10:31 pm

Re: Previous version not getting uninstalled before new version installs

I can work with that. I have to create registry entries for Solidworks to recognize the add in. The registry entries key on the GUID. I'll have to remove the old entries and create the new entries. I am concerned that I will not get all the places that need GUID's removed and added. Perhaps there is a way that I could put the old GUID and new GUID into variables and use those to search/remove and add new entries?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Previous version not getting uninstalled before new version installs

Hello,

I am not quite sure I understand what your concern is in this scenario.

If you upgrade an older version of your setup, it will simply be uninstalled (meaning that the entries will be removed) and then the newer version will be installed (re-adding the entries - if you did not remove them from the project, of course).

If you do not modify the registry entries at all in the project, they should be re-added by the newer version of your setup.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
flycast
Posts: 24
Joined: Thu Jul 25, 2019 10:31 pm

Re: Previous version not getting uninstalled before new version installs

I am not quite sure I understand what your concern is in this scenario.
My concern is I have to create a number of custom entries under two different keys. The keys are the GUID of the assembly that has to be hand set in Visual Studio. So what happens is I have to make sure that I compile the assembly with the right GUID and then do a number of removals of keys/entries of the old GUID that was created the time before. Then do a add of the new key with the new GUID.

My experience is that when there are a lot of manual operations like this it is easy to miss one.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Previous version not getting uninstalled before new version installs

Hello,

I believe there might be a misunderstading here.

Please note that you do not need to change the GUID for each of your components.

The only GUID that needs to be changed is the ProductCode GUID.
then do a number of removals of keys/entries of the old GUID that was created the time before
If you added those GUIDS through the "Registry" page, then, upon upgrading, the entries should be automatically removed when the old package is uninstalled.
Then do a add of the new key with the new GUID.
Similar to what I've said above, the regitry entries should be automatically added when the newer version of your setup is installed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
flycast
Posts: 24
Joined: Thu Jul 25, 2019 10:31 pm

Re: Previous version not getting uninstalled before new version installs

Please see my reply viewtopic.php?p=116343#p116386. I really need that one resolved first. It's been open for 9 days and no closer to resolution.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Previous version not getting uninstalled before new version installs

Hello,

I have answered in the mention thread.

Looking forward to hearing from you.

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

Return to “Common Problems”