2

To follow-up and expand upon this question, I want to know how to get a list of applications as shown in appwiz.cpl which always shows all installed applications.

From here, we know that other installers like InstallShield, Wise, NSIS do not register the applications with WMIC so

wmic product get name,version

shows me some applications including Visual C++, Apple Software Update and others but many are missing, like:

  • 7-Zip
  • Google Chrome
  • Mozilla Firefox
  • Mozilla Thunderbird
  • VLC

Is there a powershell or other method that can show all installed applications?

6
  • 1
    Can you provide an example of what isn’t listed That command would report every Win32 Desktop application installed by an installer. Any UWP application would not be reported or would any application that wasn’t installed
    – Ramhound
    Nov 20 '20 at 19:03
  • 2
    Unsolvable. All app list products work from the Windows Installer registry, but not all installers bother to keep it up to date. Some installers are "portable" and do not update anything in the registry.
    – harrymc
    Nov 20 '20 at 20:31
  • @harrymc I wonder how appwiz.cpl does it.
    – melonpine
    Nov 20 '20 at 22:39
  • 1
    Using wmic product get name,version | measure-object | select count I get 428, with gcim -Class "Win32_Product"I get a count of 212, and if I loop though SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall keys I only get a count of 101 if excluding KB patches. I would be interested to know if there is something better than gmic as well.
    – Dallas
    Nov 20 '20 at 23:01
  • 1
    I do see Mozilla Firefox with wmic though
    – Dallas
    Nov 20 '20 at 23:14
1

"Programs and Features", which can also be launched using the Control Panel file appwiz.cpl lists all applications which have registered themselves in a defined way in order to appear in this list. This is traditionally the main entry point to enable users to typically remove or modify applications that are installed.

I say traditionally, as Windows now has, under the new Settings options a 'Apps & Features' page (%Windir%\ImmersiveControlPanel\SystemSettings.exe). This list of applications also includes what are now referred to as Windows Modern apps, aka metro, full screen, or Windows Store apps. As the question was specifically about Programs and Features, this answer will not cover those.

As a developer, there are a variety of ways to create an installer to package an application, be it using Windows Installer, and therefore creating a MSI file, with a toolkit such as WiX or InstallShield. Then there are custom installers created by the developers. In any case to ensure your application appears in the above list, you only need to define two values despite there typically being many more standard values, these are:

  • DisplayName
  • UninstallPath

The "Uninstaller" keys, depending on the applications installed, can be found in the following registry locations:

32-bit computer:

  • HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

64-bit computer:

  • HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • HKCU:\SOFTWARE\Wow6432nodeMicrosoft\Windows\CurrentVersion\Uninstall
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • HKLM:\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall

Where: 32-bit applications on a 64-bit application are typically found under the Wow6432node. Those under HKCU are installer for the user, rather than the computer and is sometimes an option presented in the installer.

Therefore, to enumerate all applications installed, as Explorer.exe does, when you launch Program and Features, you have to consider the values under the above keys.

There is one additional point to note, applications can "hide" themselves from appearing in this list using the SystemComponent DWORD. The value can be 1 or 0, where 1 would hide the application from the list. The intention I assume was for system components such as .NET which wouldn't typically be managed by the user to remain hidden. This is however typically used by vendors which install multiple components for a suite and then create a unified uninstaller to make it easier to remove the application in its entirety and to remove each component in the correct order.

Therefore, the following PowerShell command, will enumerate each of the above Uninstall keys, and where the SystemComponent is not 1 and there is a DisplayName value, will print the DisplayName:

foreach ($UKey in 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall\*','HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*','HKCU:\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall\*'){foreach ($Product in (Get-ItemProperty $UKey -ErrorAction SilentlyContinue)){if($Product.DisplayName -and $Product.SystemComponent -ne 1){$Product.DisplayName}}}

Now of course there are other applications you might class as installed but if they don't register in one of the above locations they will not appear and are out of scope for the question.

There are other ways to get at the items in this list but may only return a subset due to only returning MSI based applications for example.

0

Question : Is there a powershell or other method that can show all installed applications?

Refer to How to Create a List of Your Installed Programs on Windows


$outputFile = "$env:APPDATA\Installed_Applications.txt"
$OS_Architecture = $env:PROCESSOR_ARCHITECTURE
if($OS_Architecture -eq 'x86') 
{
    #write-host '32-bit'
    $key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
}
else
{
    #write-host '64-bit'
    $key = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
}

Get-ItemProperty $Key |
        Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
            Format-Table –AutoSize |
                Out-File $outputFile -Encoding UTF8 -Force
                    Start-Process $outputFile

Here is a Self-elevate script to get everything with admin rights :

cls
# Self-elevate the script if required
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
  if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
      #$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
      $CommandLine = $MyInvocation.InvocationName
      Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
      Exit
     }
    }

$outputFile = "$env:APPDATA\Installed_Applications.txt"
$OS_Architecture = $env:PROCESSOR_ARCHITECTURE
if($OS_Architecture -eq 'x86') 
{
    #write-host '32-bit'
    $key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*"
}
else
{
    #write-host '64-bit'
    $key = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
}

Get-ItemProperty $Key |
        Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
            Format-Table –AutoSize | Out-String -Width 300 |
                Out-File $outputFile -Encoding UTF8 -Force 
                    Get-AppxPackage -AllUsers |
                        Out-File -Append $outputFile -Encoding UTF8 -Force 
                            Start $outputFile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.