确定 Windows 上的软件安装顺序

jal*_*jal 2 windows installation

我正在尝试重新创建一个环境(更具体地说,记录可重现的环境)。我偷偷怀疑某些已安装的东西可能已经踩到了相同的注册表值,并想通过重现安装各种组件的顺序来测试这一点。

但是,我无法弄清楚安装的特定顺序。我找到了注册表项“HKEY_LOCAL_MACHINE_SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”,它似乎包含已安装内容的子项,而这些子项(有时)包括 InstallDate。但是,那只有一天的分辨率,所以我无法说出同一天安装的东西的顺序。

Ctime 可以改变,不是吗?所以就这样了。否则,我没有想法。

这是在Win7上。我是unix人,请耐心等待。

谁有想法?

Rya*_*ies 5

这个应该可以。打开Powershell:

Get-WmiObject Win32_ReliabilityRecords | 
    Where-Object { $_.Message.StartsWith('Windows Installer installed') } |
    Select TimeGenerated,Message | FL
Run Code Online (Sandbox Code Playgroud)

只要启用了可靠性计数器(我相信它们应该在 Windows 7 上默认启用),这就会为您提供完整的软件安装时间列表。

您还可以在图形表示中查看此数据 perfmon /rel

示例输出:

TimeGenerated : 20141112045116.000000-000 
Message       : Windows Installer installed an update. Product Name: Microsoft Office Shared MUI (English) 2013. Product Version: 15.0.4569.1506.
                Product Language: 1033. Manufacturer: Microsoft Corporation. Update Name: Update for Microsoft Office 2013 (KB2881008) 64-Bit
                Edition. Installation success or error status: 0.

TimeGenerated : 20141112045110.000000-000 
Message       : Windows Installer installed an update. Product Name: Microsoft Office Professional Plus 2013. Product Version: 15.0.4569.1506.
                Product Language: 0. Manufacturer: Microsoft Corporation. Update Name: Update for Microsoft PowerPoint 2013 (KB2889936) 64-Bit
                Edition. Installation success or error status: 0.

TimeGenerated : 20141112045100.000000-000 
Message       : Windows Installer installed an update. Product Name: Microsoft PowerPoint MUI (English) 2013. Product Version: 15.0.4569.1506.
                Product Language: 1033. Manufacturer: Microsoft Corporation. Update Name: Update for Microsoft PowerPoint 2013 (KB2889936) 64-Bit
                Edition. Installation success or error status: 0.

TimeGenerated : 20141111002348.000000-000 
Message       : Windows Installer installed the product. Product Name: EMET 5.1. Product Version: 5.1. Product Language: 1033. Manufacturer:
                Microsoft Corporation. Installation success or error status: 0.
Run Code Online (Sandbox Code Playgroud)

那个日期/时间格式会让你烦恼吗?尝试这个:

Get-WmiObject Win32_ReliabilityRecords | 
    Where-Object { $_.Message.StartsWith('Windows Installer installed') } | 
    Select @{n='TimeGenerated';e={[System.Management.ManagementDateTimeConverter]::ToDateTime($_.TimeGenerated )}},Message | FT -AutoSize

11/11/2014 10:51:24 PM Windows Installer installed an update. Product Name: Microsoft Office Professional Plus 2013. Product Version: 15.0.4569.15...
11/11/2014 10:51:16 PM Windows Installer installed an update. Product Name: Microsoft Office Shared MUI (English) 2013. Product Version: 15.0.4569...
11/11/2014 10:51:10 PM Windows Installer installed an update. Product Name: Microsoft Office Professional Plus 2013. Product Version: 15.0.4569.15...
11/11/2014 10:51:00 PM Windows Installer installed an update. Product Name: Microsoft PowerPoint MUI (English) 2013. Product Version: 15.0.4569.15...
11/10/2014 6:23:48 PM  Windows Installer installed the product. Product Name: EMET 5.1. Product Version: 5.1. Product Language: 1033. Manufacturer...
Run Code Online (Sandbox Code Playgroud)

请注意,这将列出产品安装和补丁。如果您只想捕获更新或产品安装,请调整“已安装 Windows 安装程序...”周围的字符串。


编辑:还有几件事要注意。首先,这些数据是从事件日志数据中聚合而来的……所以如果您清除了事件日志,这些数据就会消失。其次……由Get-WMIObject……Powershell报告的日期时间格式有一个更新版本的 cmdlet Get-CIMInstance,它会自动为您将这些日期/时间转换为更易读的形式……但 Windows 7 最初并未附带Get-CIMInstance. 您需要先升级到 Powershell 3,或者只使用我上面展示的转换技术。