确定Windows上的软件安装顺序

我正在尝试重新创build一个环境(更具体地说,要logging一个可再现的环境)。 我有一个偷偷的怀疑,一些安装的东西可能已经踩在相同的registry值或值,并希望通过复制安装各种组件的顺序来testing。

但是,我很难弄清楚安装什么特定顺序的东西。 我发现registry项“HKEY_LOCAL_MACHINE_SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall”,似乎有安装的东西的子项,这些子项(有时)包括InstallDate。 但是,只有一天解决,所以我不能告诉当天安装的东西的顺序。

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

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

有人有主意吗?

这应该做的。 打开PowerShell:

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

只要启用了可靠性计数器,我相信它们在Windows 7上应该是默认的,这就给出了一个确切的软件安装时间表。

你也可以用perfmon /rel的graphics表示来看这些数据

示例输出:

 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. 

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

 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... 

请注意,这将列出产品安装和修补程序。 如果您只想捕获更新或产品安装,请调整“Windows安装程序安装…”的string。


编辑 :只是更多的事情要注意。 首先,这些数据是从事件日志数据中汇总的…所以如果您清除了事件日志,这些数据将会消失。 Second …date时间格式由Get-WMIObject报告… Powershell有一个名为Get-CIMInstance的更新版本的cmdlet,可以自动将这些date/时间转换为更易读的forms…但是Windows 7 didn最初没有Get-CIMInstance 。 您需要先升级到Powershell 3,或者只是使用上面显示的转换技术。