Where does add / remove programs pull data for the "Installed in" column?

I am working on copying a Windows 7/8 add add programs program using VBScript. I got a script to include all the correct entries, but I was not able to get it to include all the correct additional information displayed by Windows.

As an example: Windows displays the "Installed on" column with date. In some cases, he gets them from the appropriate registry keys, for example:

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\InstallDate HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\InstallDate HKUS\USER - SID\Software\Microsoft\Windows\CurrentVersion\Uninstall\InstallDate 

In fact, very few keys have InstallDate values, and Windows always populates this column. I managed to capture most of the missing dates from WMI:

  ("SELECT * FROM Win32_Product Where Description = " & "'" & strName & "'" & "") for each objSoftware in colSoftware Date = objSoftware.InstallDate 

This gives only dates from installed MSI applications.

I thought Windows β€œguessed” about dates based on Program Files / ProgramData files, but I tried to manually change them, and this is not reflected in Add / Remove. I am trying to understand how Windows pulls this date. I noticed that CCleaner can reproduce adding / removing without errors, so this information is available somewhere. I just exhausted myself looking for him.

+6
source share
1 answer

After a lot of unrest, I determined that Windows Add / Remove programs get an β€œInstalled on” date from at least three possible locations:

  • For installed MSI applications, it gets the date from WIN32_Product (in the most common way)

  • For applications other than MSI, it looks for the InstallDate value in the corresponding Uninstall registry key (Example: HKLM \ SOFTWARE \ Wow6432Node \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Google Chrome)

  • For non-MSI applications that do not have InstallDate, Windows looks at the last date that the Uninstall key was written to and uses that date for "Installed On".

It was this last method that silenced me for so long. This means that at any time when a non-MSI program is updated that does not have InstallDate and the version number in the Uninstall Key is changed, you will see that the "Installed On" date is also updated and gives the appearance of this program just Was installed.

Example: HKLM \ SOFTWARE \ Wow6432Node \ Microsoft \ Windows \ CurrentVersion \ Uninstall \ Adobe Flash Player Plugin

If your installation of Flash Player Plugin was not based on MSI, you can go to this key and change the version from 11.8.800.94 to 11.8.800.93, and your addition / removal will change the installation date to Install today.

+14
source

Source: https://habr.com/ru/post/953407/


All Articles