PDA

View Full Version : major upgrade: in old version: detect if being upgraded?



graven
07-02-2004, 11:26 AM
hi there,

i'm using "major upgrades" with basic MSI projects.

the standard concept is: when doing major upgrades, the old version is uninstalled via "silent uninstallation".

from within this OLD software package i'd like to detect whether this uninstallation has been initiated by a regular action or by an upgrade.



pseudo-code:

switch (action)
case "DoInstall":
...
break
case "DoUninstall":
if (AmBeingUpgraded)
DoThis // have to uninstall cause somebody does an upgrade
else
DoThat // have to uninstall: invoked manually (regular)


any idea how to distinguish between the two scenarios?

best regards, graven

TsungH
07-02-2004, 03:39 PM
You can use UPGRADINGPRODUCTCODE Property (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/upgradingproductcode_property.asp).