none
class win32_product misses a program listed in "Uninstall a program" console RRS feed

  • Question

  • Hi

    I'm a bit confused about this. I've installed a program, JetBrains PyCharm 4.0.2. Now I see that program listed under the Programs and Features > Uninstall a program GUI.

    But, I don't see this program listed when I run:

    get-wmiobject -class win32_product

    Why is the program listed under one, but not the other? Is there a way of retrieving the programs WMI object through Powershell?

    Thanks

    Barry

    Thursday, December 11, 2014 10:39 AM

Answers

  • Hmmm... well it was the fact that searching turned up nothing but the win32_product method that led me here.

    Another search for "ALL installed software" yielded https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteProgram-Get-list-de9fd2b4 and http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/15/use-powershell-to-find-installed-software.aspx

    These use these methods to search the registry for uninstalled keys. Presumably that is also where the "Uninstall a program" GUI element gets its own list.

    Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*

    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*


    That suits my purposes.

    • Marked as answer by blaffoy Thursday, December 11, 2014 2:33 PM
    Thursday, December 11, 2014 2:33 PM
  • Actually the GUI element does more.

    The link I posted is used like this if you actually take the time to look at it and understand the instructions:

    Here is an example of how to get the information needed to uninstallan app.

    Get-LHSInstalledApp -AppName 'HP Calendar'|%{$_.UninstallString }

    That simple.  No need to worry about registries.  It also resolves all 32 bit and 64bit apps as well as remoting.

    The GUI uses MSIExec and ther registry keys and some information stored in other locations that track Windows products.  It can be different on different OS versions.

    The GUI can be wrong.  An Unistall key can be missing and the GUI will still register a program.  The program may not exist.  With WIndows 7 and later programs this has been reduces but programs deployed by XCOPY deployment self register but may not unregister when being removed.

    Since none of this has to do with scripting you may want to post in the platform forum for you OS for more  info.


    ¯\_(ツ)_/¯


    • Edited by jrv Thursday, December 11, 2014 4:20 PM
    • Marked as answer by blaffoy Thursday, December 11, 2014 4:31 PM
    Thursday, December 11, 2014 4:18 PM

All replies

  • Win32_product only lists products installed with teh Microsoft MSI installer.  Products installed by the older Setup method are not listed.  Some third party products can also be listed that are installeld by non-MSI methods.  Finaly theinstall can be broken and the listing does not get detected by Win32_Product.

     

    ¯\_(ツ)_/¯

    Thursday, December 11, 2014 1:39 PM
  • Fair enough. Is there any Powershell method to get products installed by setup.exe, or other install methods?
    Thursday, December 11, 2014 1:42 PM
  • Yes - search in repository for scripts.

    ¯\_(ツ)_/¯

    Thursday, December 11, 2014 2:00 PM
  • Hmmm... well it was the fact that searching turned up nothing but the win32_product method that led me here.

    Another search for "ALL installed software" yielded https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteProgram-Get-list-de9fd2b4 and http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/15/use-powershell-to-find-installed-software.aspx

    These use these methods to search the registry for uninstalled keys. Presumably that is also where the "Uninstall a program" GUI element gets its own list.

    Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*

    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*


    That suits my purposes.

    • Marked as answer by blaffoy Thursday, December 11, 2014 2:33 PM
    Thursday, December 11, 2014 2:33 PM
  • That script is in repository you just didn't look close enough.  Her is one. THere are many.

    https://gallery.technet.microsoft.com/scriptcenter/Get-Installed-Application-615fa73a


    ¯\_(ツ)_/¯

    Thursday, December 11, 2014 3:11 PM
  • Hi

    I already linked to a script that does basically the same thing. https://gallery.technet.microsoft.com/scriptcenter/Get-RemoteProgram-Get-list-de9fd2b4

    I'm more interested in understanding what one of these scripts is doing under the hood. Hence, I think the most relevant answer is to say: the "Uninstall a program" GUI element lists the uninstall keys found in the registry at "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\" and "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"

    Thursday, December 11, 2014 3:52 PM
  • Here's one that works remotely and also tells you whether the installed app is 32 or 64-bit:

    Windows IT Pro: Auditing 32-Bit and 64-Bit Applications with PowerShell


    -- Bill Stewart [Bill_Stewart]

    Thursday, December 11, 2014 4:15 PM
    Moderator
  • Actually the GUI element does more.

    The link I posted is used like this if you actually take the time to look at it and understand the instructions:

    Here is an example of how to get the information needed to uninstallan app.

    Get-LHSInstalledApp -AppName 'HP Calendar'|%{$_.UninstallString }

    That simple.  No need to worry about registries.  It also resolves all 32 bit and 64bit apps as well as remoting.

    The GUI uses MSIExec and ther registry keys and some information stored in other locations that track Windows products.  It can be different on different OS versions.

    The GUI can be wrong.  An Unistall key can be missing and the GUI will still register a program.  The program may not exist.  With WIndows 7 and later programs this has been reduces but programs deployed by XCOPY deployment self register but may not unregister when being removed.

    Since none of this has to do with scripting you may want to post in the platform forum for you OS for more  info.


    ¯\_(ツ)_/¯


    • Edited by jrv Thursday, December 11, 2014 4:20 PM
    • Marked as answer by blaffoy Thursday, December 11, 2014 4:31 PM
    Thursday, December 11, 2014 4:18 PM
  • Here's one that works remotely and also tells you whether the installed app is 32 or 64-bit:

    Windows IT Pro: Auditing 32-Bit and 64-Bit Applications with PowerShell


    -- Bill Stewart [Bill_Stewart]

    That is the one I was looking for. The article is useful too. Very good Bill.


    ¯\_(ツ)_/¯

    Thursday, December 11, 2014 4:21 PM
  • Thx jrv!

    -- Bill Stewart [Bill_Stewart]

    Thursday, December 11, 2014 4:30 PM
    Moderator
  • Hey Bill,

    I wish the article was still there, because I can't find this script. I am relatively new to getting PowerShell proficient. I guess I am 5 years to late to get the download. ARGH! I'm still search for the script, as someone has had to copy the contents or the file somewhere. I wish IT Pro actually ran link checkers to see none of them work.

    If you are still around, I'd love a pointer where I could find this. AS I said, I am not giving up yet, but 15-20 minutes in and I am still searching. Hence, why I am replying to a 5 year old post. ;-)

    Cheers...

    Sunday, January 12, 2020 1:11 AM
  • The article is actually almost 10 years old and was 5 years old when Bill posted it.

    A simple search would have easily found it:

    https://www.itprotoday.com/powershell/auditing-32-bit-and-64-bit-applications-powershell


    \_(ツ)_/

    Sunday, January 12, 2020 1:20 AM
  • Right, so the problem is that the company that bought Windows IT Pro did not bother to transfer the download links or the files, so the downloads don't work unfortunately.

    I'm uploading all of the articles' scripts to GitHub gists as I get to them. You can get that one here:

    https://gist.github.com/Bill-Stewart/a524bd4ce9f2b041cba5d499ba76142c


    -- Bill Stewart [Bill_Stewart]

    Monday, January 13, 2020 10:13 PM
    Moderator