Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than msi, prefix the name with the module name and a period.
// Get all patches of per-machine installed product
public static StringCollection getAllPatches(String productCode)
{
StringCollection retList = new StringCollection();
Installer installer = (Installer)new WindowsInstaller();
if (new Version(installer.Version) < new Version("3.0"))
{
StringList patchCodes = installer.get_Patches(productCode);
if (patchCodes != null)
foreach(string patchCode in patchCodes)
{
retList.Add(patchCode);
}
}
else
{
StringBuilder szPatchCode = new StringBuilder(40);
StringBuilder szTargetProductCode = new StringBuilder(40);
StringBuilder szTargetUserSid = new StringBuilder(300);
uint pcchTargetUserSid = 300;
object junk = null;
for (uint i = 0; ; i++)
{
uint res = MsiEnumPatchesEx(
productCode, // Product code. Method enumerate only patches which applyed to specified product
null, // User SID. null needs if context == MachineContext only (4), it means to use only per-machine installations
4, // Installation context. 4 means MachineContext only.
7, // Filter bitmask. 7 means to search applyed, superseded and obsolete
i, // iterator
szPatchCode, // Return value of currently found PatchCode
szTargetProductCode, // Equals to ProductCode
out junk,
szTargetUserSid, // User SID. Indicate owner of this installation. (Here is null)
ref pcchTargetUserSid // Length of user SID
);
if (res == 0)
retList.Add(szPatchCode.ToString());
else
break;
}
}
return retList;
}
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).