Is there a simple way of determining which version of Sublime is installed via a command line or registry key on Windows? Trying to determine which version of Sublime is installed, and the registry does not have a DisplayVersion key for Sublime, nor does a version number show up in Add/Remove programs. If we can at least have a ...\sublime_text.exe --version
, where it spits out the version number (example, 3207).
Silently get version number of installed Sublime Text
This already exists, but on Windows and MacOS you need to use subl
and not sublime_text
as the command to execute:
C:\Users\tmartin>subl --version
Sublime Text Build 3208
Windows and MacOS versions of Sublime ship with two executables; one that runs the actual application (sublime_text.exe
and Sublime Text
respectively) and a second application that is a command line interface to the main application named subl
(on Linux, subl
is only provided in packaged versions of Sublime and is just a script that executes sublime_text
directly).
The main binary starts the application running, while subl
is meant to be used to interact with Sublime from the command line. When you tell subl
to open a file/folder/window/project or run a command, it passes that command on to the running Sublime Text instance (or starts it if it’s not running) and then exits (unless you tell it to -w
ait).
You can use subl --help
to see all of the arguments that you can provide here; the version number is also displayed as a part of that help.