cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Catching the upgrade event with InstallScript MSI Project

All,

Basically, what I would like to do is when the user tries to install my software on a machine that has been installed with a previous version of the software, the installer would pop a warning message to tell the user to remove the previous version of the software first before installing this version, and then exit the installation process.

When the user tries to install my software on a machine that has been installed with a previous version of the software, installer would pop a message that tells the user it's gonna perform an upgrade and the user must click on OK in this dialog box to go on. I believe there is a way to intercept this event and insert some code before or maybe after this message?

As the topic of this thread suggests, I'm using InstallScript MSI project.

Thanks a lot, guys.
Labels (1)
0 Kudos
8 Replies
Pilgrim

Re: Catching the upgrade event with InstallScript MSI Project

Use the OnBegin event handler to perform a registry search for a registry entry made during the installation of said earlier product, and upon finding said registry entry, popup a messagebox and abort.
0 Kudos

Re: Catching the upgrade event with InstallScript MSI Project

Kelter,

Thanks for reply.

I did try the method you described. The problem is, when user tries to uninstall the software, onBegin will also be called and the check will resolve to true and the uninstall process will be terminated (by calling abort). User will never be able to uninstall the software.

I think, if I want to do it the way you described, I must be able to detect that the installer is now on "Upgrade Mode" (hope that makes sense) and then perform that check iff under upgrade mode.

Did I make any incorrect assumption here?

Thanks again.
0 Kudos
Pilgrim

Re: Catching the upgrade event with InstallScript MSI Project

Various system properties such as "Installed", "IS_MAJOR_UPGRADE", "IS_MINOR_UPGRADE", "PATCH", "REINSTALL", "ProductState", etc which will give you information about the status of the installation. For example, any time the installation is run in maintenance mode (ie: the product is already installed) the "Installed" property is set.

Keep in mind that MSI is purely table-driven. Even your InstallScript MSI (event driven) project is really table driven, as I understand it. Technically, the same sequence runs each time to run your installation, but conditions on the various actions determine what actually happens during the sequence.
0 Kudos

Re: Catching the upgrade event with InstallScript MSI Project

Kelter,

Thanks a lot. Let me give that a try.
0 Kudos
Pilgrim

Use MAINTENANCE

if(!MAINTENANCE) then
//This code will only be called during installation and
//not during uninstallation
end
0 Kudos

Re: Catching the upgrade event with InstallScript MSI Project

tnand53,

Thanks for the reply.

What I'm looking for is a way to perform task only during upgrade, like running a installer when the system has already been installed with a previous version. This seem to be considered as in MAINTENANCE mode...

Thanks anyway.
0 Kudos
Pilgrim

Hey

Hey,
Y dont u put a check in registry. So when it is upgrading,u can check the value from registry and do the necessary stuff...
0 Kudos

Re: Catching the upgrade event with InstallScript MSI Project

tnand53,

The problem now is I don't know when the installer is running an upgrade..I mean, I don't know how to check that in the script. I thought there would be a system variable UPGRADE which evaluates to true or 1 when installer is running an upgrade. But it's not there.

Got any good suggestions?
0 Kudos