3

I want to do get downloaded apps and their information on computer (cross platform) with electronjs (nodejs). How can i get apps and how can i open them?

For example:

const installedApps = thisFunctionShouldReturnInstalledApps()

console.log(installedApps)

/* 
[
  "Firefox",
  "Visual Studio Code",
  "Slack",
  "Bitwarden",
  "Notion",
  "Mailspring",
  ...
]
*/

thisFunctionShouldOpenApp(installedApps[1]) // Open Visual Studio Code

Thanks you.

dotslashroot
  • 470
  • 4
  • 7

1 Answers1

0

See basically all the installed applications reside in "Program Files" and "Program Files(x86)" directories. In electron, you have access to Nodejs APIs. So these are the steps you can follow.

  1. Use fs to list all the applications inside these directories
  2. Find .exe files
  3. Get the list and execute using the spawn process, make sure you set the mode of detached=true, stdout= 'ignore', you will find this in Nodejs documentation

For other OS, you can follow this same approach, only extensions will change Thank you.