Uninstall Program as Prerequisite of Another

Got a problem you cannot solve? Try here.
Sheri_Steeves
Posts: 114
Joined: Mon Oct 22, 2012 2:14 pm

Uninstall Program as Prerequisite of Another

Postby Sheri_Steeves » Tue Jun 23, 2020 11:16 am

I have three setups, only one of which can be installed at a time. Each setup has it's own product code. I need to check for and remove the other program if it is installed.

At the beginning of my script, using the product codes, I determine if any of the other two are installed, and following what is done with the PREREQ & NEEDSUPGRADE sections, I call Install/Remove MSI REMOVE=ALL for the appropriate product code, and then continue on with my setup.

This removes the install, but doesn't remove it from the Add/Remove Programs list. It is still listed, but trying to remove it will prompt with an error message about not being able to find the setup file.

I can delete the registry keys easily enough, but is there a "proper" way to do this?

FrancescoT
Site Admin
Posts: 5047
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstall Program as Prerequisite of Another

Postby FrancescoT » Tue Jun 23, 2020 1:08 pm

It may happen that an orphan entry remains listed in Add/Remove Programs. Btw, if you try to uninstall it from Add/Remove Programs, the process will report that what you are going to remove, it's just an orphan entry.

This is how I handle it from script:
remove_orphans.jpg
remove_orphans.jpg (145.35 KiB) Viewed 380 times
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

Sheri_Steeves
Posts: 114
Joined: Mon Oct 22, 2012 2:14 pm

Re: Uninstall Program as Prerequisite of Another

Postby Sheri_Steeves » Tue Jun 23, 2020 2:55 pm

I didn't have an entry under
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall matching the DisplayName, only the PRODUCTCODE GUID, then realised that as I'm in 64-bit mode, I needed to look into the 32-bit hive under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall to remove the entry.

FrancescoT
Site Admin
Posts: 5047
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstall Program as Prerequisite of Another

Postby FrancescoT » Wed Jun 24, 2020 1:13 pm

By default, the installer runs in 32 bit mode. Consequently, the install entry will be stored into the 32-bit hive of the Registry.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 30 guests