Some Patch Detection Designer Pointers for a MSI Newbie
MSP Patch detection questions from a MSI newbie:
- Is there any API which directly consumes the Patch XML Blob and intimates if it is applicable/Installed on the target system as the whole set of information is already available in the XML blob?
- Do we have to retrieve the target product code from the blob and pass it separately to the API?
- Is there a way to just pass the MSP meta data XML to an API and get applicability status?
- For the MsiDeterminePatchSequence API, do we have to pass the first argument (szProductCode) to the function, since the XML blob contains target product codes?
Here are the pointers you may find useful
See the MSDN topic Patching Initial Installations. It tells you which API’s you can pass the XML blob to in order to determine applicability.
same as above
Have a look at the MSI sequencing API. You have two choices:
Both take a PMSIPATCHSEQUENCEINFO parameter which allows for an array of structs. Each struct has two files. A string and a type. The type indicates if it's a path to a patch file, a path to an XML file, or a path to an XML blob.
You can simply take the output from the XML extraction API and then pass it to the sequencing API.
The szProductCode parameter is required. It is not listed as optional. Therefore, yes you do have to provide it.
Normally you already have publishing data associated with a MSP that your applying and are directed to patch a particular product. Therefore you can evaluate for that product, what set of patches to be downloaded.
If you aren't mapping patches already to product codes, then yes, you have to determine them yourself. Of course, your other approach is to enumerate the products already present on the machine and then from that enumeration determine which patches that you have should be downloaded and applied using the product code you retrieved and the XML blobs.
You have other APIs like MsiEnumProductsEx and the like that can provide additional state on the machine.
Content credit also belongs to
- Carolyn, MSI Team Dev Lead. You can get other Carolyn insights about developing for Windows Installer from the Windows Installer Chat Archives
- Tyler, MSI Team PM. You can get other Tyler insights about developing for Windows Installer from the Windows Installer Chat Archives
[Author: Robert Flaming]
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.