Hello Rudy and Happy new year,
I have tested the scenario and it seems the ProductVersion property is assignated only with the upgraded version's value and it doesn't change to any of the intermediate versions during a multiple target patch. Thus, the approach I mentioned in my previous post is not a complete one in your case.
A patch is considered to be a repair/maintenance in Windows Installer so just to clarify things, this condition:
will always resolve to false during a patch. It would be enough just to check the script execution "during maintenance(repair/modify)" option.
Also this condition(using the OR operator):
(NOT Installed) OR (PATCH AND (ProductVersion = "0.9.11"))
resolves to true if any or both conditions are true. Moreover, even if the (NOT Installed) always resolved to true during a "not installed" patch, it would still be wrong because (PATCH AND (ProductVersion = "0.9.11") could be either true or false, the whole condition would resolve to true in each case. Using AND instead of OR would have accomplished what you wanted. Please note that this is a condition logic correction and the properties are not relevant.
After further investigation and discussions with the team we thought of another solution scenario you can try. Here are the steps to be applied from within your own custom action in the upgraded(1.0.1) project :
- parse the OLDPRODUCTS property which contains all the product codes of the already installed versions
- perform a custom registry search using the parsed installed version's product code in this location
Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
and retrieve the "DisplayVersion" value - get the "DisplayVersion" in a public property inside your project and use the property to condition each script(e.g. if version 0.9.10 is installed then only the 0.9.11 and 1.0.1 scripts need to run). It should look something like :
Code: Select all
PATCH AND (ScriptVersion>DISPLAY_VERSION)
Another simpler approach would be to rethink your package strategy and perhaps deliver the 1.0.1 version in one single major upgrade package.
Regards,
Mihai
FOLLOW US
Get the latest news in Application Packaging