Мислех, че това ще бъде доста лесно, но имам проблеми с използването на класа PatchInstallation, който е част от Microsoft.Deployment.WindowsInstaller.
След като получих правилния код на корекцията и кода на продукта (targetcode), аз просто извиквам свойството IsInstalled, но ArgumentNullExceptions се хвърлят.
PatchInstallation patchInstallation = new PatchInstallation(patchCode.ToString("B"), productCode.ToString("B"));
return patchInstallation.IsInstalled;
Текстът за изключение е:
System.ArgumentNullException occurred Message=Стойността не може да бъде нула. Име на параметър: String Source=mscorlib ParamName=String
StackTrace: at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) в Microsoft.Deployment.WindowsInstaller.PatchInstallation.get_State() в Microsoft.Deployment.WindowsInstaller.PatchInstallation.get_IsInstalled() InnerException:
Ако някой има някакви идеи какво правя погрешно, моля да ме уведоми! наздраве!