多くのクエリ プロセスを含むさまざまな Windows OS バージョンで、すべてのソフトウェアとホットフィックスの更新を正確に取得するアプリケーションを作成しています。具体的な方法の 1 つは、Win32_QuickFixEngineering クラスをクエリすることです。次の C# コードを使用すると、これを行うことができます。
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_QuickFixEngineering");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("Win32_QuickFixEngineering instance");
Console.WriteLine("-----------------------------------");
Console.WriteLine("HotFixID: {0}", queryObj["HotFixID"]);
}
}
catch (ManagementException e)
{
MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
}
次のような一連の結果が得られます。
HotfixID='File 1'
HotfixID='File 1'
HotfixID='File 1'
HotfixID='File 1'
HotfixID='File 1'
HotfixID='File 1'
HotfixID='File 1'
しかし、プロパティ 'ServicePackInEffect' をクエリすると、HotfixID='File 1' を持つ各クエリは次のようになります。
ServicePackInEffect='KB2259213'
ServicePackInEffect='KB2431232'
ServicePackInEffect='KB2254332-IE7'
ServicePackInEffect='KB960680-v2'
ServicePackInEffect='KB2254343'
ServicePackInEffect='KB93089483'
私の質問は、これらもアップデートですか、それともホットフィックスですか? または何?存在する場合、'File 1' という名前の HotfixID があるのはなぜですか? また、「ServicePackInEffect」が HotfixID で何をすべきかを示しているのはなぜですか?