これはかなり簡単だと思いましたが、Microsoft.Deployment.WindowsInstaller の一部である PatchInstallation クラスの使用に問題があります。
正しいパッチ コードと製品コード (targetcode) を取得したので、IsInstalled プロパティを呼び出すだけですが、ArgumentNullExceptions がスローされます。
PatchInstallation patchInstallation = new PatchInstallation(patchCode.ToString("B"), productCode.ToString("B"));
return patchInstallation.IsInstalled;
例外テキストは次のとおりです。
System.ArgumentNullException が発生しました Message=Value を null にすることはできません。パラメータ名: 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:
誰かが私が間違っていることを知っているなら、私に知らせてください! 乾杯!