Avatar of dominicwong
dominicwong
 asked on

Windows Installer does not remove previous version

Hi experts
I had a problem with my Windows Installer. It does not remove the previous installed version.

On the 'Properties' of the Installer:
I'd updated the 'Version', and click 'Yes' when prompted to change 'ProductCode'.
I had the 'RemovePreviousVersion' set to 'True'.
I had the 'DetectNewerInstalledVersion' set to 'True'.
I had the 'UpgradeCode' remain unchanged.

Could someone point to me what I am missing?

Thanks in advance.

PS. I am using VS2008.
I didn't have this problem before until I moved everything to a new HD. So something might have missed out from my settings.
Installation.NET ProgrammingC#

Avatar of undefined
Last Comment
dominicwong

8/22/2022 - Mon
AndyAinscow

>>and click 'Yes' when prompted to change 'ProductCode'.

I think you should have said no to that - the code should be how a previous version is identified.  Try setting the code to the value you had before and see if that will remove the previous version upon installation.
Vadim Rapp

Please post detailed installation log:

msiexec /l*v c:\installation.log /i <path>\installation.msi

@AndyAinscow, the product code in question applies to this version, not previous version. Previous version is identified by upgrade code, i.e. Installer searches for my upgrade code*; finds product code of the previous version, and then uninstalls product with that found product code.

*) more accurately - for the upgrade code specified in UPGRADE table. There can be several, so it's possible to upgrade several different products. It's also possible to upgrade completely different product, if you know its upgrade code.
ASKER CERTIFIED SOLUTION
Vadim Rapp

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
AndyAinscow

Ooops - I've done some more digging.
My memory was wrong, I had changed both product and upgrade codes when things went wrong.

Ignore my last comment.  :-((
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
dominicwong

ASKER
Thanks AndyAinscow and vadimrapp1.
What happened was my old HD was corrupted so I couldn't easily go back to examine.
I reckon something might be missing in my Installer project as I'd experimented it by building two versions. The newer one doesn't uninstall the older one.
I need to do more digging.
dominicwong

ASKER
I managed to resolve this issue.

There was a static red-colour icon next to the icon file under the Installer project.
The path of this icon file that had pointed to an old location. This icon file was referenced by the 'User's Program Men' under the 'File System (Installer)'.

There wasn't any error when I built the Installer project to produce installer files. I can't understand why an icon file could lead to this issue. But fixing the path of this icon file managed to resolve this issue.
dominicwong

ASKER
Thanks Andy and vadimrapp1 for your prompt responses and help. Much appreciated.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.