Is there a way to detect if Atom is installed on a computer?


#1

I need to offer to the user of my (Qt based) application the possibility to open files in Atom (since I publish and manage an Atom snippets package specially for our application).

Is there a way to detect if Atom is installed on a computer? Maybe a registry key or Path varaibale…?
This would help to encourage them to download it in case they don’t have it already.

Thanks!


#2

You can run atom --version through the system shell. If Atom is installed properly, that will return useful information. If there’s a different program behind the command atom, then a regular expression would be enough to reject responses that don’t match the specific pattern of the version response, and if no program is installed you get a predictable error message.


#3

That’s superbe! Thank you very much!

I assume this works on all platforms (Win / Mac / Linux) ?


#4

Yes… and no.

The idea works if the atom command is registered as globally accessible command line instruction. It is possible to not select this option when doing an installation. I do not know if it is possible to create an unassisted installation, but you could package a portable installation of Atom.

More info ->
https://flight-manual.atom.io/getting-started/sections/installing-atom/#portable-mode