This is a simple library that can retrieve the list of installed applications in Windows.
It is based on ListPrograms which is in turn based on a VB Script linked from a StackOverflow Post
My purpose is fairly limited, so haven't replicated all of the functionality. In particular, the following is still to be done
GetUserInstallerKeyPrograms
has not been migrated- Not all the programs will be detected if the JVM is 32 bit running on a 64bit windows (http://symbolthree.blogspot.com/2016/11/access-windows-registry-using-jna.html)
This module is not in the maven repositories, but it should be very easy to install it locally
$ git clone https://github.com/drone-ah/JavaListApps
$ cd JavaListApps
$ mvn install
You can then include it in your pom.xml
<dependency>
<groupId>com.droneah</groupId>
<artifactId>list-apps</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
The usage is very simple
Map<String, Software> list = ListApps.getInstalledApps(false);
for(Software soft: list.values()) {
System.out.println(soft.getDisplayName() + ": " + soft.getPublisher());
}