I need to get a full list of installed programs in Windows, through Java native code.
I've tried some suggestions and solutions others have pointed out, but I can't seem to get the whole list of programs.
The below code will successfully fetch most programs installed, but not all. I assume this has to do with not all programs having uninstallers, but I'm not sure at all.
try {
Process pb = Runtime.getRuntime().exec(
"powershell.exe Get-ItemProperty HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate");
BufferedReader in = new BufferedReader(new InputStreamReader(pb.getInputStream()));
String line;
while ((line = in.readLine()) != null)
System.out.println(line);
} catch (IOException e) {
e.printStackTrace();
}