I'm updating an installer written with InstallShield to perform a major upgrade of an application and have InstallScript functions invoked by custom actions to back up and restore some files from the application's directory. I have the script working with previous installation directory hardcoded but need to find the actual location that the application was installed.
I can get the location of current install using:
MsiGetProductInfo(PRODUCT_GUID, INSTALLPROPERTY_INSTALLLOCATION, savedInstallDir, bufferSize);
but if I change PRODUCT_GUID to the hardcoded value of the product code of the previous installation then I get an empty string in savedInstallDir:
MsiGetProductInfo("{my-previous-product-code}", INSTALLPROPERTY_INSTALLLOCATION, savedInstallDir, bufferSize);