WMI “installed” query different from add/remove programs list?

后端 未结 13 1902
不知归路
不知归路 2020-11-29 01:56

Trying to use WMI to obtain a list of installed programs for Windows XP. Using wmic, I tried:

wmic /output:c:\\ProgramList.txt product get name,version
         


        
13条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 02:18

    I have been using Inno Setup for an installer. I'm using 64-bit Windows 7 only. I'm finding that registry entries are being written to

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

    I haven't yet figured out how to get this list to be reported by WMI (although the program is listed as installed in Programs and Features). If I figure it out, I'll try to remember to report back here.

    UPDATE:

    Entries for 32-bit programs installed on a 64-bit machine go in that registry location. There's more written here:

    http://mdb-blog.blogspot.com/2010/09/c-check-if-programapplication-is.html

    See my comment that describes 32-bit vs 64-bit behavior in that same post here:

    http://mdb-blog.blogspot.com/2010/09/c-check-if-programapplication-is.html?showComment=1300402090679#c861009270784046894

    Unfortunately, there doesn't seem to be a way to get WMI to list all programs from the add/remove programs list (aka Programs and Features in Windows 7, not sure about Vista). My current code has dropped WMI in favor of using the registry. The code itself to interrogate the registry is even easier than using WMI. Sample code is in the above link.

提交回复
热议问题