Old Installer CustomAction fails which makes my new installer to fail - Advanced Installer Community
schiriac.robert
Posts: 1
Joined: Thu Jan 30, 2020 4:24 pm

Old Installer CustomAction fails which makes my new installer to fail

I'm updating a installer and encountered a bug in the CustomAction. I've fixed the bug and tried to build and execute and it fails.
It took me a bit to realize why it was failing with the same message over and over even though that line with the bug was modified.
I came to the conclusion that it wasn't the new installer that was failing, but the old one.

On upgrades i have:
Annotation 2020-01-31 093640.png
Annotation 2020-01-31 093640.png (43.51 KiB) Viewed 1688 times
Initially the order was Uninstall old version first and then install new version.
But i tried to switch it up to see if it has any effect.

I've tried also `Allow side by side installs of different product version` but it still seems to execute the old installer.

I'm also unable to install the old version of the installer via Programs and Features / Add or Remove Programs.
It rollsback, like it does when i try to install the new installer.

And is all because of the old installer's customAction bug.

Inside customAction there are some methods that copyFiles, search for folders, add / remove registry
The search for folder fails due to a code bug in which it searches for folders to get the installed versions.

The bug: (i didn't wrote this)

Code: Select all

path.Substring(path.LastIndexOf("2"), 4);
I've replaced in the new installer with:

Code: Select all

path.Substring(path.IndexOf("20"), 4);
I've already tried Uninstall / Repair on the old installer but as expected, it didn't worked.

I managed to uninstall it using windows fix-it tool but that doesn't help me.
I managed to uninstall it also by removing the 2020 version of the software i'm looking for in the system.

But neither of this options are good.

Is there a way to force remove the old installer using the new installer?

I'm using Advanced Installer Version 13.1 build 71115 with Enterprise license.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Old Installer CustomAction fails which makes my new installer to fail

Hello Robert and welcome to Advanced Installer forums,

As you have mentioned, this is happening due to the "Uninstall old version first and then install new version" option. Basically, this is what a major upgrade means - the older version is uninstalled and the newer version is installed.

If your failing custom action was set to run during uninstall, then this is the reason why it fails.

A way to fix this would be to open your project --> fix your problem (e.g. fix your custom action) --> rebuild your project --> on the faulty machine, run the new .MIS with the following command line:

Code: Select all

msiexec /fv <path_to_newer_MSI>
Basically, the above command will recache the MSI. After doing so, you can try to re-run the uninstall (or in this case, the upgrade) once again.

Hope this helps.

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

Return to “Common Problems”