SUMMARY It doesn't appear possible to query a Krita installation's version number programatically on Windows. The -v commandline arg pops up a messagebox rather than returning parseable text, the default install path does not include a version number, and the Windows Registry doesn't contain any versioning data. STEPS TO REPRODUCE 1. On Windows run `krita -v` 1a. Alternatively, run `kritarunner -v` OBSERVED RESULT A messagebox appears showing the version number. EXPECTED RESULT The version number is printed to the console. SOFTWARE/OS VERSIONS Windows: Windows 10 macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION Usecase: Studio pipeline tooling needs to check installed applications' versions to ensure consistency.
I suggested the workaround using the sysinfo file: https://docs.krita.org/en/reference_manual/sharing_krita_logs.html#id3 but (1) it doesn't exists before 4.2.9, versions 4.2.8 and before would need to check krita.log instead, and version 4.2.0-4.2.8 would have the trouble of determining the version of the last running of Krita and not some random, and (2) it is in general not safe for script usage, I think, because it's meant to be parsed by humans, not scripts.
Hm... it's actually Qt that decided that on Windows it needs to show a messagebox for the version, if you add the version to the arguments with parser.addVersionOption(); I think it might be best to add a QString version() method to the Krita API in libkis, so the version can be retrieved in a Python script. Is there any other meta information about the installed Krita you'd like to retrieve?
I've realized that there's an assumed requirement in this report that I should have been explicit about: the version checking needs to be available to an outside process without having to fully load and run the application. So, with that spoken, I think version/metadata method(s) would be useful in general, but not applicable to the use-case I'm considering.
Git commit d91086221728c6706a83facbd190cefff87a96e1 by Boudewijn Rempt. Committed on 22/06/2020 at 13:31. Pushed by rempt into branch 'krita/4.3'. Add a small executable to print the version Not tested on Windows yet, but this should work... M +10 -0 krita/CMakeLists.txt A +36 -0 krita/kritaversion.cpp [License: GPL (v2+)] https://invent.kde.org/graphics/krita/commit/d91086221728c6706a83facbd190cefff87a96e1
Git commit 58f15a09f8697e3cbc8ba36a29318882606c28be by Boudewijn Rempt. Committed on 22/06/2020 at 13:32. Pushed by rempt into branch 'master'. Add a small executable to print the version Not tested on Windows yet, but this should work... (cherry picked from commit d91086221728c6706a83facbd190cefff87a96e1) M +10 -0 krita/CMakeLists.txt A +36 -0 krita/kritaversion.cpp [License: GPL (v2+)] https://invent.kde.org/graphics/krita/commit/58f15a09f8697e3cbc8ba36a29318882606c28be