August 12th, 2005

Detecting repair, patch install, and patch uninstall for Windows Installer

Heath Stewart
Principal Software Engineer

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.

Author

Heath Stewart
Principal Software Engineer

Heath is an application architect and developer, looking to help educate others to learn professional development. Besides designing and developing applications he enjoys writing about intermediate and advanced topics. Heath also consults for deployment packages and scenarios within Microsoft and for external customers.

0 comments

Discussion are closed.