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

Problem in "Major upgrade" install to old (non default) install location

I have an basic msi installation package.

In some cases user had selected to install the software to say E: drive.

Now when this user had installed newer version of this software package, package did major upgrade (as intended), but when run in silent mode, it installed the software to default location (to C: drive).

Is there a way to probe (say from registry) where the old version was installed previously, and do major upgrade to this old directory instead?
Labels (1)
0 Kudos

(1) Reply
borovsky_d
Level 3

Hello.
You can read ARPINSTALLLOCATION property of previous version of your install package by using Windows Installer API:

MsiGetProductInfo(ProductCode, INSTALLPROPERTY_INSTALLLOCATION, InstallLocation, &dwSize);

Where:
ProductCode — Product Code of your previous version of product; If you use Upgrade table to detect previous version then Product code of old product can be foun in ActionProperty of old product upgrade table entry.
InstallLocation — Buffer to path.
dwSize — size of buffer.

PS: It works only if Install package of old product save path to ARPINSTALLOCATION property.
0 Kudos