e_m
Posts: 5
Joined: Tue Feb 20, 2018 10:20 am

passing installer parameters to uninstaller during upgrade

Hi, when running installer to upgrade existing product on the machine, Advanced Installer first runs uninstall of the old version and then install of the new version. I'm passing a parameter to the installer (e.g. Setup.exe PRODUCT=1) but this parameter is not passed to the uninstaller (that runs as the first step of the upgrade). I want the parameter to be passed to the msiexec of the uninstaller, is there a way to do so?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: passing installer parameters to uninstaller during upgrade

Hi and welcome to Advanced Installer forums.

Indeed, during the upgrade the old version is first uninstalled, then the new version is installed. However, the values of the properties set through the command line are used for both uninstall and install.

Can you please give me more details about your scenario and how you found that the updated property is not used by the uninstall?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
e_m
Posts: 5
Joined: Tue Feb 20, 2018 10:20 am

Re: passing installer parameters to uninstaller during upgrade

Hi, the parameter is not available to a custom action that runs during uninstall. if I run uninstall (not upgrade) the parameter is available to the custom action.

also, I ran procmon during the upgrade and I can see that the MsiExec.exe of the uninstall doesn't have the parameter in its command line.

Advanced Installer 12.5.

Thanks
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: passing installer parameters to uninstaller during upgrade

Hi,

Sorry, I misunderstood your question and I also made a mistake in my explanation above.

During the upgrade of a product, the uninstall of the old version and the install of the new version run in two different sessions of Windows Installer and their properties cannot be passed from one to another. So, the new value of a property set from the command line during the upgrade will be used only by the new version.

If you want to set a value during the upgrade that will be used on the uninstall of the old version you can implement the scenario described below:
- add a custom action in the old version that will read the values from a temporary file and execute it only on the uninstall of that version when an upgrade is performed (use this condition: UPGRADINGPRODUCTCODE)
- add a custom action in the new version that will write the values received through command line in the same temporary file and execute it as "immediate" only on the install of that version when an upgrade is performed (use this condition: OLDPRODUCTS)

In this case, during an upgrade, the new version will update the temporary file with the new values received through command line and the old version will read and use them during its uninstall.

Let me know if you have any questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: passing installer parameters to uninstaller during upgrade

You're welcome. Glad to help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”