We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ronwee
Posts: 3
Joined: Thu Feb 04, 2021 6:24 am

Package previous MSI into current MSI to uninstall the previous version

Hi I have a sticky situation.
My customer uses their SCCM to deploy all my product's old versions and recently when trying to install the new version. We encounter the resource not available problem as the previous MSI file is missing error 1714. They have requested me to package the old msi together into the new MSI to remove the old version. Is this even possible?

I have read through a few of the articles in the community. What I need is, how can I uninstall those previous versions with my new package, if the MSI is missing on their end.

I still have all the older versions so is there a way for me to create a MSI that can package the old msi files too and use that to uninstall the older version?
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Package previous MSI into current MSI to uninstall the previous version

Hello,

Given this situation, I can think of two ways we can try to remove the old package:

1. in the new MSI wrapper, you can try to add a newer version of the product installed on your client's machine, as a prerequisite. For instance, if version 1.0.0 is installed on the client's machine, we can try to add version 2.0.0 in the wrapper. This should try to perform a major upgrade, meaning:

- the older version (1.0.0) should be uninstalled

- the newer version (2.0.0) should be installed

2. you can add the old version of the MSI file as a temporary file and then through a custom action launch the msiexec.exe with the "/x" parameter (meaning uninstall), e.g.:

Code: Select all

msiexec.exe /x <path_to_old_msi>
As a custom action, you could use our predefined "Launch FIle" custom action.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ronwee
Posts: 3
Joined: Thu Feb 04, 2021 6:24 am

Re: Package previous MSI into current MSI to uninstall the previous version

Hi,
having issues with both methods. method 1, when I put in my new installer, it tries to remove the older version, but the previous version msi is missing in their c:\windows\installer folder. Which is why they could not uninstall in the first place. When I put in the old msi files as the pre-requisite, it only have install options, no uninstall options. To make matters even more challenging, this whole upgrade need to be silent also.

For method two, as this is a silent installation, I am not sure when is the temp folder created. I put in the entire folder with all my previous MSI files, but when I run the msiexec /x /qn for to uninstall the old version, the installer just keep repeating there is an error and wouldn't continue.

ron
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Package previous MSI into current MSI to uninstall the previous version

Hello Ron,
For method two, as this is a silent installation, I am not sure when is the temp folder created. I put in the entire folder with all my previous MSI files, but when I run the msiexec /x /qn for to uninstall the old version, the installer just keep repeating there is an error and wouldn't continue.
As per the article I've linked above about temporary files:
Temporary Files are copied during the CostFinalize standard action, at the beginning of the setup and removed during the InstallFinalize standard action.
How do I uninstall another MSI package when my application is uninstalled?

The above article explains how to achieve this. Of course, some things may need to be twisted so they fit your specific scenario.

One important thing to keep in mind is this:
The custom action is launched asynchronously because two MSI-based installations cannot run at the same time. This way the custom action runs right after the main install process is finished.
Hope this helps!

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

Return to “Building Installers”