About Windows Installer, the .NET Framework, and Visual Studio.
A frequently asked question is how to detect whether a product installed using Windows Installer is being repaired, or a patch is being installed or — starting with Windows Installer 3.0 — uninstalled. The answer is detecting which properties are set.
When a product — or even a single feature or multiple features — is being repaired the REINSTALL property is set; however, understand that patching is the act of transforming the view of the original product and re-installing features that contain files to be patched. That means the REINSTALL property will also be set during patch install and uninstall scenarios.
When patching a product, the PATCH property is set to a single or — starting with Windows Installer 3.0 — semicolon-delimited list of patches (.msp files). If that property is set than you can condition your actions to run during patch installation scenarios. When a patch is being uninstalled you can check if the MsiPatchRemovalList property is defined. This contains a semicolon-delimited list of the patch codes being removed. You can also use the MSIPATCHREMOVE property — a single or semicolon-delimited list of patch codes or patches (.msp files), but the MsiPatchRemovalList property is recommended.
For more information about conditions in Windows Installer, read Using Properties in Conditional Statements in the Windows Installer SDK.
Where exactly we need to add script to detect patch from a patch.?
@Prashant, I don't understand your question. Can you clarify?
@Heath.....can we detect existence(installed or uninstalled) of another patchB from patchA using these property...u just described.....
If yes, how and where we can apply it.....I think 'control action inside msi" can do that.
I reached you through mail also....and I described my question there more clarified.
@Prashant, no. Those properties only list patches being installed or removed. Why do you need to detect which MSPs are installed within your product session? Having to know this usually means that you're trying to condition things which you should try to avoid.
Also, once an MSP is selected to install or uninstall, you can do nothing from within the MSI UI besides cancel or proceed with the install. MSP sequencing is determined long before the UI even has a change to run and is immutable for the remainder of the installation.