Hello Assaf,
I see what you mean. Unfortunately there's no way to uninstall the previous version while setting a property using the Upgrades page.
Is there any way we can run our code before the Install Execution Stage (in silent install, before the msiexec that is).
Generally it is not a best practice to uninstall any product silently without the user's consent. This is most likely the reason for the limitation to set
installer properties while uninstalling silently using the predefined Windows Installer support from Upgrades page (
Upgrade Code based). Moreover, mandatory uninstall properties like
password or
serial should be set manually by the user from the UI.
You could try something else but it's a bit tricky/hacky: create a wrapper pre-install prerequisite installer that executes the uninstall custom action (from the article I linked in my earlier posts) before the main install. Let me know if you want to try this so I can give you some more details about the settings.
Another question, when the Upgrade action starts, how is the older MSI uninstalled?
To put in context you can follow the
Windows Installer Standard Actions article. First
FindRelatedProducts from Searches group is executed, then
RemoveExistingProducts from Preparing group.
Since two MSI processes cannot run at the same time and
RemoveExistingProducts standard action is executed during Install Execution Stage, Windows Installer uses a different approach internally.
All the best,
Mihai
FOLLOW US
Get the latest news in Application Packaging