qgis-deployment-cli
qgis-deployment-cli copied to clipboard
[Feature Request]: Get installed QGIS versions
Context
When creating shortcuts, QDT needs to know the location of the QGIS executable to point to.
Currently, this is done by defining the QDT_QGIS_EXE_PATH environment variable, then fallbacking to searching with which or then a hard-coded value corresponding to the default path of the latest LTR official msi installer.
Description
Add a new job to find a QGIS installed version to use:
Expected logic
- retrieve published versions of QGIS with dates and type (LTR, normal...) calling the Github API to list tags on qgis/qgis
- integrate this in the form of a sub-command (
qdt check-installed-qgis) for example, which outputs a structured file (with associated JSON schema)- this file is embedded into the packaging during the CI (for offline use)
- this file is published in the documentation (this may be useful to others)
- if not, dynamic calls can be made from the internal code
- the sub-command compares the published and installed versions:
- predefined environment variable (to allow admins to specify the version officially supported by the IS)
- registry (winreg) for Windows
- known paths:
C:\OSGeo4W64, etc. - :warning: manage access rights errors, in particular the listing on
%PROGRAMFILES%: execution in non-admin mode by default - for linux, there's less effort to be made a priori,
whichis sufficient in most cases
Sample job configuration:
Not contractual.
- name: Find installed QGIS
uses: qgis-installation-finder
with:
versions_priority:
- !ENV["QDT_QGIS_PREFERRED_VERSION", "ltr"]
- 3.28
- 3.30
if_not_found: error
Sample structured list
Not contractual.
{
"updated": "2023-05-29 12:35:00",
"published_versions": [
{
"major": "3",
"minor": "28",
"potential_ltr": true,
"supported_until": "2024-02-10 00:00:00",
"patches": [
{
"patch": "6",
"published": "2023-05-29 01:00:00",
"type": "ltr"
},
{
"patch": "5",
"published": "2023-04-29 01:00:00",
"type": "ltr"
},
[...]
{
"patch": "0",
"published": "2022-10-14 01:00:00",
"type": "regular"
}
]
},
{
"major": "3",
"minor": "30",
"potential_ltr": false,
"supported_until": "2023-08-10 00:00:00",
"patches": [
{
"patch": "2",
"published": "2023-05-29 01:00:00",
"type": "regular"
}
]
}
]
}
Related links
- QGIS Dev list about where to find a structured list of QGIS versions: https://lists.osgeo.org/pipermail/qgis-developer/2023-May/065849.html
Use Cases
In Windows, there are often multiple versions installed. It could help to avoid requiring an environment variable to be set
Impacted jobs:
- shortcuts manager
- profiles sync: check if the profile is compatible with installed QGIS versions
Visuals
No response
Before submitting
- [X] I have verified that my idea is a change request and not a bug report.
Partly implemented by @jmkerloch in #464 and released in https://github.com/Guts/qgis-deployment-cli/releases/tag/0.33.0
The actual implementation is enough for now.