Page 1 of 1

Uninstall Program as Prerequisite of Another

Posted: Tue Jun 23, 2020 11:16 am
by Sheri_Steeves
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?

Re: Uninstall Program as Prerequisite of Another

Posted: Tue Jun 23, 2020 1:08 pm
by FrancescoT
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 2539 times

Re: Uninstall Program as Prerequisite of Another

Posted: Tue Jun 23, 2020 2:55 pm
by Sheri_Steeves
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.

Re: Uninstall Program as Prerequisite of Another

Posted: Wed Jun 24, 2020 1:13 pm
by FrancescoT
By default, the installer runs in 32 bit mode. Consequently, the install entry will be stored into the 32-bit hive of the Registry.