alter_ego_dev2
Posts: 25
Joined: Wed May 10, 2023 4:09 pm

Application can't update because of unistall custom action fail

Hey,
I've confronted a problem when a user can't update to the next version because of the current version's custom action fail.
Since upgrade process uninstalls old version first and then installs new version, it can't be fixed in the new version.

Could you please recommend any way how the problem could be solved without manually current version removal?

P.S. It seems we could change Upgrades/Order to "Install new version first and then uninstall old version", but this way brings a lot of side effects and requires additional development and testing efforts.
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Application can't update because of unistall custom action fail

Hello,

In order to fix/remove the old version, you can use one of the solutions described in the How do I remove a broken installation FAQ article.

Let me know if you have other questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alter_ego_dev2
Posts: 25
Joined: Wed May 10, 2023 4:09 pm

Re: Application can't update because of unistall custom action fail

Thank you for a such quick response.
In my case, all users just get a new version of the application installer and I can't execute additional commands in each user's computer before the update.

If we could somehow to include the command line in the next version (maybe as custom action) and the next version could remove broken version without any additional commands. Is it possible?

In case we don't build msi package, is it possible to use msiexec.exe with exe installer to remove broken installation?
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Application can't update because of unistall custom action fail

Hello,

In this case, a possible solution that might work would be to add the new MSI (the one with the fixed custom action on uninstall) as a Temp file in the upgrade setup and launch it from a batch file with the recache command.

You need to run the upgrade setup with full UI so that you can launch the BAT file on the UI stage (and possibly silent).

Basically:

1. Fix the uninstall problem and build the new setup.
2. Create the upgrade project.
3. Add the fixed setup from step 1 as a Temporary file in the Files and Folders page.
4. Add a batch file as a temporary file with the "msiexec /fv <path_to_new_msi>" command, replace the path with the path of your temporary file. You can use the property name of the temporary file and pass it to the batch file, as explained in the Pass parameters to the .bat file article.
5. Now, during UI stage, you can call the batch script using a File to launch custom action.

However, only if a few customers are affected by the uninstall problem, I would recommend manually uninstalling the faulty setup on these machines using the Microsoft Fixit tool.

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”