From 8695165fec056e1b55af1ac45cb12ab09deb06d4 Mon Sep 17 00:00:00 2001 From: Chris Kennard Date: Fri, 2 Oct 2026 12:00:06 -0700 Subject: [PATCH 1/4] Add QGIS and QGIS LTR as macOS and Windows Fleet-maintained apps --- .../ingesters/homebrew/ingester.go | 18 +++++ .../ingesters/homebrew/ingester_test.go | 27 +++++++- .../inputs/homebrew/qgis-ltr.json | 10 +++ ee/maintained-apps/inputs/homebrew/qgis.json | 10 +++ .../inputs/homebrew/scripts/qgis-install.sh | 62 ++++++++++++++++++ .../homebrew/scripts/qgis-ltr-install.sh | 51 ++++++++++++++ .../homebrew/scripts/qgis-ltr-uninstall.sh | 24 +++++++ .../inputs/homebrew/scripts/qgis-uninstall.sh | 29 ++++++++ .../inputs/winget/qgis-ltr.json | 14 ++++ ee/maintained-apps/inputs/winget/qgis.json | 14 ++++ .../winget/scripts/qgis-ltr_install.ps1 | 48 ++++++++++++++ .../winget/scripts/qgis-ltr_uninstall.ps1 | 43 ++++++++++++ .../inputs/winget/scripts/qgis_install.ps1 | 47 +++++++++++++ .../inputs/winget/scripts/qgis_uninstall.ps1 | 42 ++++++++++++ ee/maintained-apps/outputs/apps.json | 28 ++++++++ .../outputs/qgis-ltr/darwin.json | 23 +++++++ .../outputs/qgis-ltr/windows.json | 24 +++++++ ee/maintained-apps/outputs/qgis/darwin.json | 23 +++++++ ee/maintained-apps/outputs/qgis/windows.json | 23 +++++++ .../SoftwarePage/components/icons/index.ts | 3 + .../components/icons/png/Qgis.png | Bin 0 -> 3888 bytes pkg/patch_policy/patch_policy.go | 2 + .../assets/images/app-icon-qgis-60x60@2x.png | Bin 0 -> 3888 bytes .../images/app-icon-qgis-ltr-60x60@2x.png | Bin 0 -> 3888 bytes 24 files changed, 564 insertions(+), 1 deletion(-) create mode 100644 ee/maintained-apps/inputs/homebrew/qgis-ltr.json create mode 100644 ee/maintained-apps/inputs/homebrew/qgis.json create mode 100644 ee/maintained-apps/inputs/homebrew/scripts/qgis-install.sh create mode 100644 ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-install.sh create mode 100644 ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-uninstall.sh create mode 100644 ee/maintained-apps/inputs/homebrew/scripts/qgis-uninstall.sh create mode 100644 ee/maintained-apps/inputs/winget/qgis-ltr.json create mode 100644 ee/maintained-apps/inputs/winget/qgis.json create mode 100644 ee/maintained-apps/inputs/winget/scripts/qgis-ltr_install.ps1 create mode 100644 ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 create mode 100644 ee/maintained-apps/inputs/winget/scripts/qgis_install.ps1 create mode 100644 ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 create mode 100644 ee/maintained-apps/outputs/qgis-ltr/darwin.json create mode 100644 ee/maintained-apps/outputs/qgis-ltr/windows.json create mode 100644 ee/maintained-apps/outputs/qgis/darwin.json create mode 100644 ee/maintained-apps/outputs/qgis/windows.json create mode 100644 frontend/pages/SoftwarePage/components/icons/png/Qgis.png create mode 100644 website/assets/images/app-icon-qgis-60x60@2x.png create mode 100644 website/assets/images/app-icon-qgis-ltr-60x60@2x.png diff --git a/ee/maintained-apps/ingesters/homebrew/ingester.go b/ee/maintained-apps/ingesters/homebrew/ingester.go index b7eab7290be..41dca633476 100644 --- a/ee/maintained-apps/ingesters/homebrew/ingester.go +++ b/ee/maintained-apps/ingesters/homebrew/ingester.go @@ -164,6 +164,10 @@ func (i *brewIngester) ingestOne(ctx context.Context, input inputApp) (*maintain out.UniqueIdentifier, ) } + if pathFilter, ok := qgisPathFilters[input.Token]; ok { + // The patch policy generated below inherits this filter. + out.Queries.Exists = fmt.Sprintf("SELECT 1 FROM apps WHERE bundle_identifier = '%s' AND %s;", out.UniqueIdentifier, pathFilter) + } out.Slug = input.Slug out.DefaultCategories = input.DefaultCategories @@ -364,10 +368,24 @@ func (i *brewIngester) ingestOne(ctx context.Context, input inputApp) (*maintain out.UniqueIdentifier, ) } + if pathFilter, ok := qgisPathFilters[input.Token]; ok { + // Only this channel's copy counts as open; the other channel doesn't block its install. + out.Queries.Open = fmt.Sprintf( + "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps a JOIN processes p ON p.path = concat(a.path, '/Contents/MacOS/', a.bundle_executable) WHERE a.bundle_identifier = '%s' AND a.%s AND a.bundle_executable != '');", + out.UniqueIdentifier, pathFilter, + ) + } return out, nil } +// qgisPathFilters tells QGIS and QGIS LTR apart by where their casks install them: +// both report the org.qgis.qgis3 bundle identifier. +var qgisPathFilters = map[string]string{ + "qgis": "path LIKE '/Applications/QGIS-final-%.app'", + "qgis@ltr": "path = '/Applications/QGIS-LTR.app'", +} + var firefoxBetaVersionPattern = regexp.MustCompile(`^(\d+(?:\.\d+)*)b\d+$`) // firefoxBetaBaseVersion strips the beta suffix from a Firefox pre-release diff --git a/ee/maintained-apps/ingesters/homebrew/ingester_test.go b/ee/maintained-apps/ingesters/homebrew/ingester_test.go index 05eba92c0e4..73e223e0108 100644 --- a/ee/maintained-apps/ingesters/homebrew/ingester_test.go +++ b/ee/maintained-apps/ingesters/homebrew/ingester_test.go @@ -87,7 +87,7 @@ func TestIngestValidations(t *testing.T) { Version: "1.0", } - case "ok", "1password", "docker-desktop", "microsoft-edge", "google-chrome", "webex", "i1profiler", "steam", "swiftdialog", "teleport-suite", "r-app", "install_script_path", "uninstall_script_path", "uninstall_script_path_with_pre", "uninstall_script_path_with_post", "patch_policy_path", "open-query": + case "ok", "1password", "docker-desktop", "microsoft-edge", "google-chrome", "webex", "i1profiler", "steam", "swiftdialog", "teleport-suite", "r-app", "qgis", "qgis@ltr", "install_script_path", "uninstall_script_path", "uninstall_script_path_with_pre", "uninstall_script_path_with_post", "patch_policy_path", "open-query": cask = brewCask{ Token: appToken, Name: []string{appToken}, @@ -154,6 +154,8 @@ func TestIngestValidations(t *testing.T) { {"", inputApp{Token: "swiftdialog", UniqueIdentifier: "au.csiro.dialog", InstallerFormat: "pkg", Name: "swiftDialog", Slug: "swiftdialog/darwin"}}, {"", inputApp{Token: "teleport-suite", UniqueIdentifier: "com.gravitational.teleport.tsh", InstallerFormat: "pkg", Name: "Teleport Suite", Slug: "teleport-suite/darwin"}}, {"", inputApp{Token: "r-app", UniqueIdentifier: "org.R-project.R", InstallerFormat: "pkg", Name: "R for macOS", Slug: "r/darwin"}}, + {"", inputApp{Token: "qgis", UniqueIdentifier: "org.qgis.qgis3", InstallerFormat: "dmg", Name: "QGIS", Slug: "qgis/darwin"}}, + {"", inputApp{Token: "qgis@ltr", UniqueIdentifier: "org.qgis.qgis3", InstallerFormat: "dmg", Name: "QGIS LTR", Slug: "qgis-ltr/darwin"}}, {"", inputApp{Token: "install_script_path", UniqueIdentifier: "abc", InstallerFormat: "pkg", InstallScriptPath: path.Join(tempDir, "install_script.sh")}}, {"", inputApp{Token: "uninstall_script_path", UniqueIdentifier: "abc", InstallerFormat: "pkg", UninstallScriptPath: path.Join(tempDir, "uninstall_script.sh")}}, {"", inputApp{Token: "open-query", UniqueIdentifier: "com.example.app", InstallerFormat: "pkg", Name: "Example App"}}, @@ -259,6 +261,19 @@ func TestIngestValidations(t *testing.T) { "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'org.R-project.R' AND version_compare(REGEX_MATCH(bundle_short_version, 'R (?:R )?([0-9]+(?:\\.[0-9]+)+) GUI', 1), '1.0') < 0);", out.Queries.Patched, ) + case "qgis": + // QGIS and QGIS LTR share a bundle identifier, so each is scoped to its install path. + require.Equal(t, "SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path LIKE '/Applications/QGIS-final-%.app';", out.Queries.Exists) + require.Equal(t, + "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path LIKE '/Applications/QGIS-final-%.app' AND version_compare(bundle_short_version, '1.0') < 0);", + out.Queries.Patched, + ) + case "qgis@ltr": + require.Equal(t, "SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path = '/Applications/QGIS-LTR.app';", out.Queries.Exists) + require.Equal(t, + "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path = '/Applications/QGIS-LTR.app' AND version_compare(bundle_short_version, '1.0') < 0);", + out.Queries.Patched, + ) default: require.Equal(t, fmt.Sprintf("SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = '%s' AND version_compare(bundle_short_version, '%s') < 0);", c.inputApp.UniqueIdentifier, out.Version), @@ -273,6 +288,16 @@ func TestIngestValidations(t *testing.T) { fmt.Sprintf("SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps a JOIN processes p ON (p.path = concat(a.path, '/Contents/MacOS/', a.bundle_executable) OR p.path LIKE concat('%%/', a.bundle_identifier, '.code_sign_clone/%%/Contents/MacOS/', a.bundle_executable)) WHERE a.bundle_identifier = '%s' AND a.bundle_executable != '');", out.UniqueIdentifier), out.Queries.Open, ) + case "qgis": + require.Equal(t, + "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps a JOIN processes p ON p.path = concat(a.path, '/Contents/MacOS/', a.bundle_executable) WHERE a.bundle_identifier = 'org.qgis.qgis3' AND a.path LIKE '/Applications/QGIS-final-%.app' AND a.bundle_executable != '');", + out.Queries.Open, + ) + case "qgis@ltr": + require.Equal(t, + "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps a JOIN processes p ON p.path = concat(a.path, '/Contents/MacOS/', a.bundle_executable) WHERE a.bundle_identifier = 'org.qgis.qgis3' AND a.path = '/Applications/QGIS-LTR.app' AND a.bundle_executable != '');", + out.Queries.Open, + ) default: // The managed "is app open" query matches only the app's own executable, so // in-bundle login items and helpers that outlive the app don't count as open. diff --git a/ee/maintained-apps/inputs/homebrew/qgis-ltr.json b/ee/maintained-apps/inputs/homebrew/qgis-ltr.json new file mode 100644 index 00000000000..30d933841d5 --- /dev/null +++ b/ee/maintained-apps/inputs/homebrew/qgis-ltr.json @@ -0,0 +1,10 @@ +{ + "name": "QGIS LTR", + "slug": "qgis-ltr/darwin", + "unique_identifier": "org.qgis.qgis3", + "token": "qgis@ltr", + "installer_format": "dmg", + "install_script_path": "ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-install.sh", + "uninstall_script_path": "ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-uninstall.sh", + "default_categories": ["Productivity"] +} diff --git a/ee/maintained-apps/inputs/homebrew/qgis.json b/ee/maintained-apps/inputs/homebrew/qgis.json new file mode 100644 index 00000000000..09fe87a7c2c --- /dev/null +++ b/ee/maintained-apps/inputs/homebrew/qgis.json @@ -0,0 +1,10 @@ +{ + "name": "QGIS", + "slug": "qgis/darwin", + "unique_identifier": "org.qgis.qgis3", + "token": "qgis", + "installer_format": "dmg", + "install_script_path": "ee/maintained-apps/inputs/homebrew/scripts/qgis-install.sh", + "uninstall_script_path": "ee/maintained-apps/inputs/homebrew/scripts/qgis-uninstall.sh", + "default_categories": ["Productivity"] +} diff --git a/ee/maintained-apps/inputs/homebrew/scripts/qgis-install.sh b/ee/maintained-apps/inputs/homebrew/scripts/qgis-install.sh new file mode 100644 index 00000000000..f03c061387e --- /dev/null +++ b/ee/maintained-apps/inputs/homebrew/scripts/qgis-install.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# QGIS is closed if it's running, and unsaved project changes are lost. Each +# release installs as its own QGIS-final-.app, so earlier releases are +# removed once the new one is in place. QGIS LTR (QGIS-LTR.app) is left alone. + +APPDIR="/Applications" +TMPDIR=$(dirname "$(realpath "$INSTALLER_PATH")") + +# QGIS and QGIS LTR share a bundle identifier, so match processes by path. +quit_app_at_path() { + local app_path="$1" + local pattern="^${app_path}/Contents/MacOS/" + pgrep -f "$pattern" >/dev/null || return 0 + echo "Closing $app_path..." + pkill -TERM -f "$pattern" + for _ in {1..10}; do + pgrep -f "$pattern" >/dev/null || return 0 + sleep 1 + done + echo "$app_path did not close; forcing it to quit." + pkill -KILL -f "$pattern" +} + +MOUNT_POINT=$(mktemp -d /tmp/dmg_mount_XXXXXX) +yes | hdiutil attach -plist -nobrowse -readonly -mountpoint "$MOUNT_POINT" "$INSTALLER_PATH" >/dev/null || exit 1 +trap 'hdiutil detach "$MOUNT_POINT" >/dev/null 2>&1 || true' EXIT + +NEW_APP=$(find "$MOUNT_POINT" -maxdepth 1 -name 'QGIS-final-*.app' -print -quit) +if [[ -z "$NEW_APP" ]]; then + echo "No QGIS-final-*.app found in the disk image." + exit 1 +fi +APP_NAME=$(basename "$NEW_APP") + +for app in "$APPDIR"/QGIS-final-*.app; do + [[ -d "$app" ]] && quit_app_at_path "$app" +done + +sudo rm -rf "$TMPDIR/$APP_NAME.bkp" +if [[ -d "$APPDIR/$APP_NAME" ]]; then + sudo mv "$APPDIR/$APP_NAME" "$TMPDIR/$APP_NAME.bkp" || exit $? +fi +if ! sudo cp -R "$NEW_APP" "$APPDIR/"; then + # remove the partial copy so a failed install isn't inventoried as the new + # version, then restore the previous version if there was one + sudo rm -rf "$APPDIR/$APP_NAME" + if [[ -d "$TMPDIR/$APP_NAME.bkp" ]]; then + sudo mv "$TMPDIR/$APP_NAME.bkp" "$APPDIR/$APP_NAME" + fi + exit 1 +fi +sudo rm -rf "$TMPDIR/$APP_NAME.bkp" + +for app in "$APPDIR"/QGIS-final-*.app; do + if [[ -d "$app" && "$(basename "$app")" != "$APP_NAME" ]]; then + echo "Removing earlier release $app" + sudo rm -rf "$app" + fi +done + +echo "Installed $APPDIR/$APP_NAME" diff --git a/ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-install.sh b/ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-install.sh new file mode 100644 index 00000000000..6a6901345f7 --- /dev/null +++ b/ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-install.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# QGIS LTR is closed if it's running, and unsaved project changes are lost. It +# installs as QGIS-LTR.app so it can sit alongside QGIS, which is left alone. + +APPDIR="/Applications" +TMPDIR=$(dirname "$(realpath "$INSTALLER_PATH")") +APP_PATH="$APPDIR/QGIS-LTR.app" + +# QGIS and QGIS LTR share a bundle identifier, so match processes by path. +quit_app_at_path() { + local app_path="$1" + local pattern="^${app_path}/Contents/MacOS/" + pgrep -f "$pattern" >/dev/null || return 0 + echo "Closing $app_path..." + pkill -TERM -f "$pattern" + for _ in {1..10}; do + pgrep -f "$pattern" >/dev/null || return 0 + sleep 1 + done + echo "$app_path did not close; forcing it to quit." + pkill -KILL -f "$pattern" +} + +MOUNT_POINT=$(mktemp -d /tmp/dmg_mount_XXXXXX) +yes | hdiutil attach -plist -nobrowse -readonly -mountpoint "$MOUNT_POINT" "$INSTALLER_PATH" >/dev/null || exit 1 +trap 'hdiutil detach "$MOUNT_POINT" >/dev/null 2>&1 || true' EXIT + +if [[ ! -d "$MOUNT_POINT/QGIS.app" ]]; then + echo "No QGIS.app found in the disk image." + exit 1 +fi + +quit_app_at_path "$APP_PATH" + +sudo rm -rf "$TMPDIR/QGIS-LTR.app.bkp" +if [[ -d "$APP_PATH" ]]; then + sudo mv "$APP_PATH" "$TMPDIR/QGIS-LTR.app.bkp" || exit $? +fi +if ! sudo cp -R "$MOUNT_POINT/QGIS.app" "$APP_PATH"; then + # remove the partial copy so a failed install isn't inventoried as the new + # version, then restore the previous version if there was one + sudo rm -rf "$APP_PATH" + if [[ -d "$TMPDIR/QGIS-LTR.app.bkp" ]]; then + sudo mv "$TMPDIR/QGIS-LTR.app.bkp" "$APP_PATH" + fi + exit 1 +fi +sudo rm -rf "$TMPDIR/QGIS-LTR.app.bkp" + +echo "Installed $APP_PATH" diff --git a/ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-uninstall.sh b/ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-uninstall.sh new file mode 100644 index 00000000000..aaa4ad57b56 --- /dev/null +++ b/ee/maintained-apps/inputs/homebrew/scripts/qgis-ltr-uninstall.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Removes QGIS-LTR.app and closes it if it's running. QGIS and per-user QGIS +# data (profiles, plugins, caches), which QGIS also uses, are left in place. + +APP_PATH="/Applications/QGIS-LTR.app" + +# QGIS and QGIS LTR share a bundle identifier, so match processes by path. +quit_app_at_path() { + local app_path="$1" + local pattern="^${app_path}/Contents/MacOS/" + pgrep -f "$pattern" >/dev/null || return 0 + echo "Closing $app_path..." + pkill -TERM -f "$pattern" + for _ in {1..10}; do + pgrep -f "$pattern" >/dev/null || return 0 + sleep 1 + done + echo "$app_path did not close; forcing it to quit." + pkill -KILL -f "$pattern" +} + +quit_app_at_path "$APP_PATH" +sudo rm -rf "$APP_PATH" diff --git a/ee/maintained-apps/inputs/homebrew/scripts/qgis-uninstall.sh b/ee/maintained-apps/inputs/homebrew/scripts/qgis-uninstall.sh new file mode 100644 index 00000000000..9c2e3089866 --- /dev/null +++ b/ee/maintained-apps/inputs/homebrew/scripts/qgis-uninstall.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Removes every QGIS-final-.app and closes QGIS if it's running. QGIS +# LTR and per-user QGIS data (profiles, plugins, caches), which QGIS LTR also +# uses, are left in place. + +APPDIR="/Applications" + +# QGIS and QGIS LTR share a bundle identifier, so match processes by path. +quit_app_at_path() { + local app_path="$1" + local pattern="^${app_path}/Contents/MacOS/" + pgrep -f "$pattern" >/dev/null || return 0 + echo "Closing $app_path..." + pkill -TERM -f "$pattern" + for _ in {1..10}; do + pgrep -f "$pattern" >/dev/null || return 0 + sleep 1 + done + echo "$app_path did not close; forcing it to quit." + pkill -KILL -f "$pattern" +} + +for app in "$APPDIR"/QGIS-final-*.app; do + [[ -d "$app" ]] || continue + quit_app_at_path "$app" + echo "Removing $app" + sudo rm -rf "$app" +done diff --git a/ee/maintained-apps/inputs/winget/qgis-ltr.json b/ee/maintained-apps/inputs/winget/qgis-ltr.json new file mode 100644 index 00000000000..534f5f51685 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/qgis-ltr.json @@ -0,0 +1,14 @@ +{ + "name": "QGIS LTR", + "slug": "qgis-ltr/windows", + "package_identifier": "OSGeo.QGIS_LTR", + "unique_identifier": "QGIS", + "fuzzy_match_name": true, + "exists_query": "SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version LIKE '3.44.%';", + "installer_arch": "x64", + "installer_type": "msi", + "installer_scope": "machine", + "install_script_path": "ee/maintained-apps/inputs/winget/scripts/qgis-ltr_install.ps1", + "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1", + "default_categories": ["Productivity"] +} diff --git a/ee/maintained-apps/inputs/winget/qgis.json b/ee/maintained-apps/inputs/winget/qgis.json new file mode 100644 index 00000000000..f6c2c68754e --- /dev/null +++ b/ee/maintained-apps/inputs/winget/qgis.json @@ -0,0 +1,14 @@ +{ + "name": "QGIS", + "slug": "qgis/windows", + "package_identifier": "OSGeo.QGIS", + "unique_identifier": "QGIS", + "fuzzy_match_name": true, + "exists_query": "SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version NOT LIKE '3.44.%';", + "installer_arch": "x64", + "installer_type": "msi", + "installer_scope": "machine", + "install_script_path": "ee/maintained-apps/inputs/winget/scripts/qgis_install.ps1", + "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1", + "default_categories": ["Productivity"] +} diff --git a/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_install.ps1 b/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_install.ps1 new file mode 100644 index 00000000000..2cd60ba7f6c --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_install.ps1 @@ -0,0 +1,48 @@ +# Each QGIS release installs side by side under its own product code, so +# installed QGIS LTR (3.44.x) releases are uninstalled first. Other QGIS +# releases are left in place. + +$ltrSeries = '3.44.' +$logFile = "${env:TEMP}/fleet-install-software.log" + +# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED, +# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure. +$successCodes = @(0, 3010, 1641) + +try { + +$uninstallRoots = @( + 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', + 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' +) +$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object { + $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and + ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and + $_.PSChildName -match '^\{[0-9A-Fa-f-]+\}$' +}) +foreach ($entry in $entries) { + Write-Host "Uninstalling $($entry.DisplayName) ($($entry.PSChildName))" + $process = Start-Process msiexec.exe -ArgumentList "/x $($entry.PSChildName) /qn /norestart" -PassThru -Wait + # 1605 = the release was already uninstalled + if (($successCodes + 1605) -notcontains $process.ExitCode) { + Write-Host "Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)" + Exit $process.ExitCode + } +} + +$installProcess = Start-Process msiexec.exe ` + -ArgumentList "/quiet /norestart /lv `"${logFile}`" /i `"${env:INSTALLER_PATH}`"" ` + -PassThru -Verb RunAs -Wait + +Get-Content $logFile -Tail 500 + +if ($successCodes -contains $installProcess.ExitCode) { + Exit 0 +} + +Exit $installProcess.ExitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 new file mode 100644 index 00000000000..b3f134cb32c --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 @@ -0,0 +1,43 @@ +# Uninstalls every QGIS LTR (3.44.x) release on the host, since each release +# installs side by side under its own product code. Other QGIS releases are +# left in place. + +$ltrSeries = '3.44.' + +# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED, +# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled. +$successCodes = @(0, 3010, 1641, 1605) + +try { + +$uninstallRoots = @( + 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', + 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' +) +$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object { + $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and + ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and + $_.PSChildName -match '^\{[0-9A-Fa-f-]+\}$' +}) + +if ($entries.Count -eq 0) { + Write-Host "No QGIS LTR installation found." + Exit 1 +} + +$exitCode = 0 +foreach ($entry in $entries) { + Write-Host "Uninstalling $($entry.DisplayName) ($($entry.PSChildName))" + $process = Start-Process msiexec.exe -ArgumentList "/x $($entry.PSChildName) /qn /norestart" -PassThru -Wait + Write-Host "Uninstall exit code: $($process.ExitCode)" + if ($successCodes -notcontains $process.ExitCode) { + $exitCode = $process.ExitCode + } +} + +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/qgis_install.ps1 b/ee/maintained-apps/inputs/winget/scripts/qgis_install.ps1 new file mode 100644 index 00000000000..b0e12eeb63a --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/qgis_install.ps1 @@ -0,0 +1,47 @@ +# Each QGIS release installs side by side under its own product code, so +# installed QGIS releases are uninstalled first. QGIS LTR (3.44.x) is left in place. + +$ltrSeries = '3.44.' +$logFile = "${env:TEMP}/fleet-install-software.log" + +# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED, +# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure. +$successCodes = @(0, 3010, 1641) + +try { + +$uninstallRoots = @( + 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', + 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' +) +$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object { + $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and + -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and + $_.PSChildName -match '^\{[0-9A-Fa-f-]+\}$' +}) +foreach ($entry in $entries) { + Write-Host "Uninstalling $($entry.DisplayName) ($($entry.PSChildName))" + $process = Start-Process msiexec.exe -ArgumentList "/x $($entry.PSChildName) /qn /norestart" -PassThru -Wait + # 1605 = the release was already uninstalled + if (($successCodes + 1605) -notcontains $process.ExitCode) { + Write-Host "Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)" + Exit $process.ExitCode + } +} + +$installProcess = Start-Process msiexec.exe ` + -ArgumentList "/quiet /norestart /lv `"${logFile}`" /i `"${env:INSTALLER_PATH}`"" ` + -PassThru -Verb RunAs -Wait + +Get-Content $logFile -Tail 500 + +if ($successCodes -contains $installProcess.ExitCode) { + Exit 0 +} + +Exit $installProcess.ExitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 new file mode 100644 index 00000000000..56211391e5d --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 @@ -0,0 +1,42 @@ +# Uninstalls every QGIS release on the host, since each release installs side +# by side under its own product code. QGIS LTR (3.44.x) is left in place. + +$ltrSeries = '3.44.' + +# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED, +# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled. +$successCodes = @(0, 3010, 1641, 1605) + +try { + +$uninstallRoots = @( + 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', + 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' +) +$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object { + $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and + -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and + $_.PSChildName -match '^\{[0-9A-Fa-f-]+\}$' +}) + +if ($entries.Count -eq 0) { + Write-Host "No QGIS installation found." + Exit 1 +} + +$exitCode = 0 +foreach ($entry in $entries) { + Write-Host "Uninstalling $($entry.DisplayName) ($($entry.PSChildName))" + $process = Start-Process msiexec.exe -ArgumentList "/x $($entry.PSChildName) /qn /norestart" -PassThru -Wait + Write-Host "Uninstall exit code: $($process.ExitCode)" + if ($successCodes -notcontains $process.ExitCode) { + $exitCode = $process.ExitCode + } +} + +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/outputs/apps.json b/ee/maintained-apps/outputs/apps.json index 12516f0de96..fffc8d81e9e 100644 --- a/ee/maintained-apps/outputs/apps.json +++ b/ee/maintained-apps/outputs/apps.json @@ -7197,6 +7197,34 @@ "unique_identifier": "QEMU", "description": "QEMU is an open-source machine emulator and virtualizer." }, + { + "name": "QGIS LTR", + "slug": "qgis-ltr/darwin", + "platform": "darwin", + "unique_identifier": "org.qgis.qgis3", + "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + }, + { + "name": "QGIS LTR", + "slug": "qgis-ltr/windows", + "platform": "windows", + "unique_identifier": "QGIS", + "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + }, + { + "name": "QGIS", + "slug": "qgis/darwin", + "platform": "darwin", + "unique_identifier": "org.qgis.qgis3", + "description": "QGIS is a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + }, + { + "name": "QGIS", + "slug": "qgis/windows", + "platform": "windows", + "unique_identifier": "QGIS", + "description": "QGIS is a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + }, { "name": "QLab", "slug": "qlab/darwin", diff --git a/ee/maintained-apps/outputs/qgis-ltr/darwin.json b/ee/maintained-apps/outputs/qgis-ltr/darwin.json new file mode 100644 index 00000000000..10c843c74a8 --- /dev/null +++ b/ee/maintained-apps/outputs/qgis-ltr/darwin.json @@ -0,0 +1,23 @@ +{ + "versions": [ + { + "version": "3.44.15", + "queries": { + "exists": "SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path = '/Applications/QGIS-LTR.app';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path = '/Applications/QGIS-LTR.app' AND version_compare(bundle_short_version, '3.44.15') < 0);", + "open": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps a JOIN processes p ON p.path = concat(a.path, '/Contents/MacOS/', a.bundle_executable) WHERE a.bundle_identifier = 'org.qgis.qgis3' AND a.path = '/Applications/QGIS-LTR.app' AND a.bundle_executable != '');" + }, + "installer_url": "https://download.qgis.org/downloads/macos/ltr/qgis_ltr_final-3_44_15.dmg", + "install_script_ref": "739271d0", + "uninstall_script_ref": "e0ff26e6", + "sha256": "302547ebee16d4d38ddfd509469cc86e337b23c545307cdbe13c2c2d233ab7cb", + "default_categories": [ + "Productivity" + ] + } + ], + "refs": { + "739271d0": "#!/bin/bash\n\n# QGIS LTR is closed if it's running, and unsaved project changes are lost. It\n# installs as QGIS-LTR.app so it can sit alongside QGIS, which is left alone.\n\nAPPDIR=\"/Applications\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\nAPP_PATH=\"$APPDIR/QGIS-LTR.app\"\n\n# QGIS and QGIS LTR share a bundle identifier, so match processes by path.\nquit_app_at_path() {\n local app_path=\"$1\"\n local pattern=\"^${app_path}/Contents/MacOS/\"\n pgrep -f \"$pattern\" >/dev/null || return 0\n echo \"Closing $app_path...\"\n pkill -TERM -f \"$pattern\"\n for _ in {1..10}; do\n pgrep -f \"$pattern\" >/dev/null || return 0\n sleep 1\n done\n echo \"$app_path did not close; forcing it to quit.\"\n pkill -KILL -f \"$pattern\"\n}\n\nMOUNT_POINT=$(mktemp -d /tmp/dmg_mount_XXXXXX)\nyes | hdiutil attach -plist -nobrowse -readonly -mountpoint \"$MOUNT_POINT\" \"$INSTALLER_PATH\" >/dev/null || exit 1\ntrap 'hdiutil detach \"$MOUNT_POINT\" >/dev/null 2>&1 || true' EXIT\n\nif [[ ! -d \"$MOUNT_POINT/QGIS.app\" ]]; then\n echo \"No QGIS.app found in the disk image.\"\n exit 1\nfi\n\nquit_app_at_path \"$APP_PATH\"\n\nsudo rm -rf \"$TMPDIR/QGIS-LTR.app.bkp\"\nif [[ -d \"$APP_PATH\" ]]; then\n sudo mv \"$APP_PATH\" \"$TMPDIR/QGIS-LTR.app.bkp\" || exit $?\nfi\nif ! sudo cp -R \"$MOUNT_POINT/QGIS.app\" \"$APP_PATH\"; then\n # remove the partial copy so a failed install isn't inventoried as the new\n # version, then restore the previous version if there was one\n sudo rm -rf \"$APP_PATH\"\n if [[ -d \"$TMPDIR/QGIS-LTR.app.bkp\" ]]; then\n sudo mv \"$TMPDIR/QGIS-LTR.app.bkp\" \"$APP_PATH\"\n fi\n exit 1\nfi\nsudo rm -rf \"$TMPDIR/QGIS-LTR.app.bkp\"\n\necho \"Installed $APP_PATH\"\n", + "e0ff26e6": "#!/bin/bash\n\n# Removes QGIS-LTR.app and closes it if it's running. QGIS and per-user QGIS\n# data (profiles, plugins, caches), which QGIS also uses, are left in place.\n\nAPP_PATH=\"/Applications/QGIS-LTR.app\"\n\n# QGIS and QGIS LTR share a bundle identifier, so match processes by path.\nquit_app_at_path() {\n local app_path=\"$1\"\n local pattern=\"^${app_path}/Contents/MacOS/\"\n pgrep -f \"$pattern\" >/dev/null || return 0\n echo \"Closing $app_path...\"\n pkill -TERM -f \"$pattern\"\n for _ in {1..10}; do\n pgrep -f \"$pattern\" >/dev/null || return 0\n sleep 1\n done\n echo \"$app_path did not close; forcing it to quit.\"\n pkill -KILL -f \"$pattern\"\n}\n\nquit_app_at_path \"$APP_PATH\"\nsudo rm -rf \"$APP_PATH\"\n" + } +} diff --git a/ee/maintained-apps/outputs/qgis-ltr/windows.json b/ee/maintained-apps/outputs/qgis-ltr/windows.json new file mode 100644 index 00000000000..27de868b91a --- /dev/null +++ b/ee/maintained-apps/outputs/qgis-ltr/windows.json @@ -0,0 +1,24 @@ +{ + "versions": [ + { + "version": "3.44.14", + "queries": { + "exists": "SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version LIKE '3.44.%';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version LIKE '3.44.%' AND version_compare(version, '3.44.14') < 0);", + "open": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM processes WHERE LOWER(name) = 'qgis-ltr-bin.exe');" + }, + "installer_url": "https://qgis.org/downloads/QGIS-OSGeo4W-3.44.14-1.msi", + "install_script_ref": "c1308e76", + "uninstall_script_ref": "c7c40f33", + "sha256": "0a579f980dcec85be2ecb47c5f08234ca6ce7b625c3cb9543eded1f43d445b46", + "default_categories": [ + "Productivity" + ], + "upgrade_code": "{C9417C88-E128-1014-9195-A75173304312}" + } + ], + "refs": { + "c1308e76": "# Each QGIS release installs side by side under its own product code, so\n# installed QGIS LTR (3.44.x) releases are uninstalled first. Other QGIS\n# releases are left in place.\n\n$ltrSeries = '3.44.'\n$logFile = \"${env:TEMP}/fleet-install-software.log\"\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure.\n$successCodes = @(0, 3010, 1641)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n # 1605 = the release was already uninstalled\n if (($successCodes + 1605) -notcontains $process.ExitCode) {\n Write-Host \"Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)\"\n Exit $process.ExitCode\n }\n}\n\n$installProcess = Start-Process msiexec.exe `\n -ArgumentList \"/quiet /norestart /lv `\"${logFile}`\" /i `\"${env:INSTALLER_PATH}`\"\" `\n -PassThru -Verb RunAs -Wait\n\nGet-Content $logFile -Tail 500\n\nif ($successCodes -contains $installProcess.ExitCode) {\n Exit 0\n}\n\nExit $installProcess.ExitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "c7c40f33": "# Uninstalls every QGIS LTR (3.44.x) release on the host, since each release\n# installs side by side under its own product code. Other QGIS releases are\n# left in place.\n\n$ltrSeries = '3.44.'\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled.\n$successCodes = @(0, 3010, 1641, 1605)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\n\nif ($entries.Count -eq 0) {\n Write-Host \"No QGIS LTR installation found.\"\n Exit 1\n}\n\n$exitCode = 0\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n Write-Host \"Uninstall exit code: $($process.ExitCode)\"\n if ($successCodes -notcontains $process.ExitCode) {\n $exitCode = $process.ExitCode\n }\n}\n\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + } +} diff --git a/ee/maintained-apps/outputs/qgis/darwin.json b/ee/maintained-apps/outputs/qgis/darwin.json new file mode 100644 index 00000000000..69d4c0ba2ca --- /dev/null +++ b/ee/maintained-apps/outputs/qgis/darwin.json @@ -0,0 +1,23 @@ +{ + "versions": [ + { + "version": "4.2.3", + "queries": { + "exists": "SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path LIKE '/Applications/QGIS-final-%.app';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'org.qgis.qgis3' AND path LIKE '/Applications/QGIS-final-%.app' AND version_compare(bundle_short_version, '4.2.3') < 0);", + "open": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps a JOIN processes p ON p.path = concat(a.path, '/Contents/MacOS/', a.bundle_executable) WHERE a.bundle_identifier = 'org.qgis.qgis3' AND a.path LIKE '/Applications/QGIS-final-%.app' AND a.bundle_executable != '');" + }, + "installer_url": "https://download.qgis.org/downloads/macos/pr/qgis_pr_final-4_2_3.dmg", + "install_script_ref": "e04037ef", + "uninstall_script_ref": "06c5d7d0", + "sha256": "cf3af3d3d228a0e2a0ab7fb6b37052ae78064d0aef93b12f41f9bd724fd23401", + "default_categories": [ + "Productivity" + ] + } + ], + "refs": { + "06c5d7d0": "#!/bin/bash\n\n# Removes every QGIS-final-.app and closes QGIS if it's running. QGIS\n# LTR and per-user QGIS data (profiles, plugins, caches), which QGIS LTR also\n# uses, are left in place.\n\nAPPDIR=\"/Applications\"\n\n# QGIS and QGIS LTR share a bundle identifier, so match processes by path.\nquit_app_at_path() {\n local app_path=\"$1\"\n local pattern=\"^${app_path}/Contents/MacOS/\"\n pgrep -f \"$pattern\" >/dev/null || return 0\n echo \"Closing $app_path...\"\n pkill -TERM -f \"$pattern\"\n for _ in {1..10}; do\n pgrep -f \"$pattern\" >/dev/null || return 0\n sleep 1\n done\n echo \"$app_path did not close; forcing it to quit.\"\n pkill -KILL -f \"$pattern\"\n}\n\nfor app in \"$APPDIR\"/QGIS-final-*.app; do\n [[ -d \"$app\" ]] || continue\n quit_app_at_path \"$app\"\n echo \"Removing $app\"\n sudo rm -rf \"$app\"\ndone\n", + "e04037ef": "#!/bin/bash\n\n# QGIS is closed if it's running, and unsaved project changes are lost. Each\n# release installs as its own QGIS-final-.app, so earlier releases are\n# removed once the new one is in place. QGIS LTR (QGIS-LTR.app) is left alone.\n\nAPPDIR=\"/Applications\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n\n# QGIS and QGIS LTR share a bundle identifier, so match processes by path.\nquit_app_at_path() {\n local app_path=\"$1\"\n local pattern=\"^${app_path}/Contents/MacOS/\"\n pgrep -f \"$pattern\" >/dev/null || return 0\n echo \"Closing $app_path...\"\n pkill -TERM -f \"$pattern\"\n for _ in {1..10}; do\n pgrep -f \"$pattern\" >/dev/null || return 0\n sleep 1\n done\n echo \"$app_path did not close; forcing it to quit.\"\n pkill -KILL -f \"$pattern\"\n}\n\nMOUNT_POINT=$(mktemp -d /tmp/dmg_mount_XXXXXX)\nyes | hdiutil attach -plist -nobrowse -readonly -mountpoint \"$MOUNT_POINT\" \"$INSTALLER_PATH\" >/dev/null || exit 1\ntrap 'hdiutil detach \"$MOUNT_POINT\" >/dev/null 2>&1 || true' EXIT\n\nNEW_APP=$(find \"$MOUNT_POINT\" -maxdepth 1 -name 'QGIS-final-*.app' -print -quit)\nif [[ -z \"$NEW_APP\" ]]; then\n echo \"No QGIS-final-*.app found in the disk image.\"\n exit 1\nfi\nAPP_NAME=$(basename \"$NEW_APP\")\n\nfor app in \"$APPDIR\"/QGIS-final-*.app; do\n [[ -d \"$app\" ]] && quit_app_at_path \"$app\"\ndone\n\nsudo rm -rf \"$TMPDIR/$APP_NAME.bkp\"\nif [[ -d \"$APPDIR/$APP_NAME\" ]]; then\n sudo mv \"$APPDIR/$APP_NAME\" \"$TMPDIR/$APP_NAME.bkp\" || exit $?\nfi\nif ! sudo cp -R \"$NEW_APP\" \"$APPDIR/\"; then\n # remove the partial copy so a failed install isn't inventoried as the new\n # version, then restore the previous version if there was one\n sudo rm -rf \"$APPDIR/$APP_NAME\"\n if [[ -d \"$TMPDIR/$APP_NAME.bkp\" ]]; then\n sudo mv \"$TMPDIR/$APP_NAME.bkp\" \"$APPDIR/$APP_NAME\"\n fi\n exit 1\nfi\nsudo rm -rf \"$TMPDIR/$APP_NAME.bkp\"\n\nfor app in \"$APPDIR\"/QGIS-final-*.app; do\n if [[ -d \"$app\" && \"$(basename \"$app\")\" != \"$APP_NAME\" ]]; then\n echo \"Removing earlier release $app\"\n sudo rm -rf \"$app\"\n fi\ndone\n\necho \"Installed $APPDIR/$APP_NAME\"\n" + } +} diff --git a/ee/maintained-apps/outputs/qgis/windows.json b/ee/maintained-apps/outputs/qgis/windows.json new file mode 100644 index 00000000000..4886fa4a4f5 --- /dev/null +++ b/ee/maintained-apps/outputs/qgis/windows.json @@ -0,0 +1,23 @@ +{ + "versions": [ + { + "version": "4.2.2", + "queries": { + "exists": "SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version NOT LIKE '3.44.%';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version NOT LIKE '3.44.%' AND version_compare(version, '4.2.2') < 0);", + "open": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM processes WHERE LOWER(name) = 'qgis-bin.exe');" + }, + "installer_url": "https://qgis.org/downloads/QGIS-OSGeo4W-4.2.2-1.msi", + "install_script_ref": "b661d065", + "uninstall_script_ref": "de9e823f", + "sha256": "dda0db34626053027844f8f90a0acee614fe06fc56eb07d00e9da7f1447472b3", + "default_categories": [ + "Productivity" + ] + } + ], + "refs": { + "b661d065": "# Each QGIS release installs side by side under its own product code, so\n# installed QGIS releases are uninstalled first. QGIS LTR (3.44.x) is left in place.\n\n$ltrSeries = '3.44.'\n$logFile = \"${env:TEMP}/fleet-install-software.log\"\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure.\n$successCodes = @(0, 3010, 1641)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n # 1605 = the release was already uninstalled\n if (($successCodes + 1605) -notcontains $process.ExitCode) {\n Write-Host \"Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)\"\n Exit $process.ExitCode\n }\n}\n\n$installProcess = Start-Process msiexec.exe `\n -ArgumentList \"/quiet /norestart /lv `\"${logFile}`\" /i `\"${env:INSTALLER_PATH}`\"\" `\n -PassThru -Verb RunAs -Wait\n\nGet-Content $logFile -Tail 500\n\nif ($successCodes -contains $installProcess.ExitCode) {\n Exit 0\n}\n\nExit $installProcess.ExitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "de9e823f": "# Uninstalls every QGIS release on the host, since each release installs side\n# by side under its own product code. QGIS LTR (3.44.x) is left in place.\n\n$ltrSeries = '3.44.'\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled.\n$successCodes = @(0, 3010, 1641, 1605)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\n\nif ($entries.Count -eq 0) {\n Write-Host \"No QGIS installation found.\"\n Exit 1\n}\n\n$exitCode = 0\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n Write-Host \"Uninstall exit code: $($process.ExitCode)\"\n if ($successCodes -notcontains $process.ExitCode) {\n $exitCode = $process.ExitCode\n }\n}\n\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + } +} diff --git a/frontend/pages/SoftwarePage/components/icons/index.ts b/frontend/pages/SoftwarePage/components/icons/index.ts index 53f4dabe7d5..b2c01d1f22c 100644 --- a/frontend/pages/SoftwarePage/components/icons/index.ts +++ b/frontend/pages/SoftwarePage/components/icons/index.ts @@ -847,6 +847,7 @@ import PyCharmCe from "./png/PyCharmCe.png"; import Python313 from "./png/Python313.png"; import Python314 from "./png/Python314.png"; import Qemu from "./png/Qemu.png"; +import Qgis from "./png/Qgis.png"; import Qlab from "./png/Qlab.png"; import Qlmarkdown from "./png/Qlmarkdown.png"; import QspacePro from "./png/QspacePro.png"; @@ -2033,6 +2034,8 @@ export const SOFTWARE_NAME_TO_ICON_MAP = { "python 3.13": Python313, "python 3.14": Python314, qemu: Qemu, + qgis: Qgis, + "qgis ltr": Qgis, qlab: Qlab, "qspace pro": QspacePro, quip: Quip, diff --git a/frontend/pages/SoftwarePage/components/icons/png/Qgis.png b/frontend/pages/SoftwarePage/components/icons/png/Qgis.png new file mode 100644 index 0000000000000000000000000000000000000000..80f7035552c67175ca0915e31bc6413705f50ee3 GIT binary patch literal 3888 zcmW+(2{_dM^M8N#VBJUMidy9OQV6+Y-N~(VxI&U#5wY%dM&+m|sc(xMN$xwxcNZN* z$k9b;6A8Q6U2Cn~pa1`PX67~X%ro=M%rnn3&ty3{SPSq<@d5w@Y))CY>>=*|7zN*x z)VX`xdjLhaSet>`kJ5kk48&Dads6@!a`{+3$UWbEC%dzj)?s!>jvRr(U@0Xb>>SZz z>RY0A~vyUU#uy)xQBQA;kwgFXoF+EoPmAWj}?zL+Dpc(x)(@FJ}vjQ%{_^DVgH1XoYfMzN?oGPnKE0jj0`lDWV5lHUGq6_ow1fw=b1C;w^tRD zzFGbqm(qD5_MaU{fWy(BawlnX1Ro`4?3~*nYZNMw_6ANq+bJBIo^9yKh z)*)HJ(psHuC1SGtM7%{&ABV7-S{%bIdMtU>GJ8>#+e7WqYV6_e#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q3O*sg5`$6qXL1b|^+%={BD_j8GLraAdK7Z&s0TN_e z4GM}9pn#eesm4Z$aDSKpp^eotJ|a?LNjbkWwfRk1I9-b*+jmMX6YKP+LfSTPgPZ)KR)yY$zQ+yO_&R4fma?o+X-NdPa1g$6WuhW!%&n_l<_Y#7rHqX?Z&;9$2>lMD=h=cu6!9#K8zX8?5 zc{k;DkVu6@&ak|oVerEfWGR<7RApUTXh0WWk{)*o{67{gASNwaJET?3r*Z@+)MU{OV0F9>|Yp{y*J zZPZFm?j?C~%E%R4Sx;*j)YRnr^^dhlUo3(cb#U`{GI$eL%z**azv)UpO? Date: Fri, 2 Oct 2026 12:28:54 -0700 Subject: [PATCH 2/4] Rename QGIS LTR slug to qgis@ltr and treat absent QGIS as uninstalled on Windows --- .../ingesters/homebrew/ingester_test.go | 2 +- .../homebrew/{qgis-ltr.json => qgis@ltr.json} | 2 +- .../winget/{qgis-ltr.json => qgis@ltr.json} | 2 +- .../winget/scripts/qgis-ltr_uninstall.ps1 | 4 +-- .../inputs/winget/scripts/qgis_uninstall.ps1 | 4 +-- ee/maintained-apps/outputs/apps.json | 24 +++++++++--------- ee/maintained-apps/outputs/qgis/windows.json | 6 ++--- .../{qgis-ltr => qgis@ltr}/darwin.json | 0 .../{qgis-ltr => qgis@ltr}/windows.json | 6 ++--- ...@2x.png => app-icon-qgis@ltr-60x60@2x.png} | Bin 10 files changed, 25 insertions(+), 25 deletions(-) rename ee/maintained-apps/inputs/homebrew/{qgis-ltr.json => qgis@ltr.json} (92%) rename ee/maintained-apps/inputs/winget/{qgis-ltr.json => qgis@ltr.json} (94%) rename ee/maintained-apps/outputs/{qgis-ltr => qgis@ltr}/darwin.json (100%) rename ee/maintained-apps/outputs/{qgis-ltr => qgis@ltr}/windows.json (83%) rename website/assets/images/{app-icon-qgis-ltr-60x60@2x.png => app-icon-qgis@ltr-60x60@2x.png} (100%) diff --git a/ee/maintained-apps/ingesters/homebrew/ingester_test.go b/ee/maintained-apps/ingesters/homebrew/ingester_test.go index 73e223e0108..fffb351edb2 100644 --- a/ee/maintained-apps/ingesters/homebrew/ingester_test.go +++ b/ee/maintained-apps/ingesters/homebrew/ingester_test.go @@ -155,7 +155,7 @@ func TestIngestValidations(t *testing.T) { {"", inputApp{Token: "teleport-suite", UniqueIdentifier: "com.gravitational.teleport.tsh", InstallerFormat: "pkg", Name: "Teleport Suite", Slug: "teleport-suite/darwin"}}, {"", inputApp{Token: "r-app", UniqueIdentifier: "org.R-project.R", InstallerFormat: "pkg", Name: "R for macOS", Slug: "r/darwin"}}, {"", inputApp{Token: "qgis", UniqueIdentifier: "org.qgis.qgis3", InstallerFormat: "dmg", Name: "QGIS", Slug: "qgis/darwin"}}, - {"", inputApp{Token: "qgis@ltr", UniqueIdentifier: "org.qgis.qgis3", InstallerFormat: "dmg", Name: "QGIS LTR", Slug: "qgis-ltr/darwin"}}, + {"", inputApp{Token: "qgis@ltr", UniqueIdentifier: "org.qgis.qgis3", InstallerFormat: "dmg", Name: "QGIS LTR", Slug: "qgis@ltr/darwin"}}, {"", inputApp{Token: "install_script_path", UniqueIdentifier: "abc", InstallerFormat: "pkg", InstallScriptPath: path.Join(tempDir, "install_script.sh")}}, {"", inputApp{Token: "uninstall_script_path", UniqueIdentifier: "abc", InstallerFormat: "pkg", UninstallScriptPath: path.Join(tempDir, "uninstall_script.sh")}}, {"", inputApp{Token: "open-query", UniqueIdentifier: "com.example.app", InstallerFormat: "pkg", Name: "Example App"}}, diff --git a/ee/maintained-apps/inputs/homebrew/qgis-ltr.json b/ee/maintained-apps/inputs/homebrew/qgis@ltr.json similarity index 92% rename from ee/maintained-apps/inputs/homebrew/qgis-ltr.json rename to ee/maintained-apps/inputs/homebrew/qgis@ltr.json index 30d933841d5..9544b2a888d 100644 --- a/ee/maintained-apps/inputs/homebrew/qgis-ltr.json +++ b/ee/maintained-apps/inputs/homebrew/qgis@ltr.json @@ -1,6 +1,6 @@ { "name": "QGIS LTR", - "slug": "qgis-ltr/darwin", + "slug": "qgis@ltr/darwin", "unique_identifier": "org.qgis.qgis3", "token": "qgis@ltr", "installer_format": "dmg", diff --git a/ee/maintained-apps/inputs/winget/qgis-ltr.json b/ee/maintained-apps/inputs/winget/qgis@ltr.json similarity index 94% rename from ee/maintained-apps/inputs/winget/qgis-ltr.json rename to ee/maintained-apps/inputs/winget/qgis@ltr.json index 534f5f51685..e02a7b43440 100644 --- a/ee/maintained-apps/inputs/winget/qgis-ltr.json +++ b/ee/maintained-apps/inputs/winget/qgis@ltr.json @@ -1,6 +1,6 @@ { "name": "QGIS LTR", - "slug": "qgis-ltr/windows", + "slug": "qgis@ltr/windows", "package_identifier": "OSGeo.QGIS_LTR", "unique_identifier": "QGIS", "fuzzy_match_name": true, diff --git a/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 index b3f134cb32c..db2dee01ce0 100644 --- a/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 +++ b/ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1 @@ -21,8 +21,8 @@ $entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinu }) if ($entries.Count -eq 0) { - Write-Host "No QGIS LTR installation found." - Exit 1 + Write-Host "No QGIS LTR installation found; nothing to uninstall." + Exit 0 } $exitCode = 0 diff --git a/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 index 56211391e5d..d75d28a9a2b 100644 --- a/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 +++ b/ee/maintained-apps/inputs/winget/scripts/qgis_uninstall.ps1 @@ -20,8 +20,8 @@ $entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinu }) if ($entries.Count -eq 0) { - Write-Host "No QGIS installation found." - Exit 1 + Write-Host "No QGIS installation found; nothing to uninstall." + Exit 0 } $exitCode = 0 diff --git a/ee/maintained-apps/outputs/apps.json b/ee/maintained-apps/outputs/apps.json index fffc8d81e9e..cb724004ae5 100644 --- a/ee/maintained-apps/outputs/apps.json +++ b/ee/maintained-apps/outputs/apps.json @@ -7198,32 +7198,32 @@ "description": "QEMU is an open-source machine emulator and virtualizer." }, { - "name": "QGIS LTR", - "slug": "qgis-ltr/darwin", + "name": "QGIS", + "slug": "qgis/darwin", "platform": "darwin", "unique_identifier": "org.qgis.qgis3", - "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + "description": "QGIS is a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." }, { - "name": "QGIS LTR", - "slug": "qgis-ltr/windows", + "name": "QGIS", + "slug": "qgis/windows", "platform": "windows", "unique_identifier": "QGIS", - "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + "description": "QGIS is a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." }, { - "name": "QGIS", - "slug": "qgis/darwin", + "name": "QGIS LTR", + "slug": "qgis@ltr/darwin", "platform": "darwin", "unique_identifier": "org.qgis.qgis3", - "description": "QGIS is a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." }, { - "name": "QGIS", - "slug": "qgis/windows", + "name": "QGIS LTR", + "slug": "qgis@ltr/windows", "platform": "windows", "unique_identifier": "QGIS", - "description": "QGIS is a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." + "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." }, { "name": "QLab", diff --git a/ee/maintained-apps/outputs/qgis/windows.json b/ee/maintained-apps/outputs/qgis/windows.json index 4886fa4a4f5..28181937664 100644 --- a/ee/maintained-apps/outputs/qgis/windows.json +++ b/ee/maintained-apps/outputs/qgis/windows.json @@ -9,7 +9,7 @@ }, "installer_url": "https://qgis.org/downloads/QGIS-OSGeo4W-4.2.2-1.msi", "install_script_ref": "b661d065", - "uninstall_script_ref": "de9e823f", + "uninstall_script_ref": "37b1cac3", "sha256": "dda0db34626053027844f8f90a0acee614fe06fc56eb07d00e9da7f1447472b3", "default_categories": [ "Productivity" @@ -17,7 +17,7 @@ } ], "refs": { - "b661d065": "# Each QGIS release installs side by side under its own product code, so\n# installed QGIS releases are uninstalled first. QGIS LTR (3.44.x) is left in place.\n\n$ltrSeries = '3.44.'\n$logFile = \"${env:TEMP}/fleet-install-software.log\"\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure.\n$successCodes = @(0, 3010, 1641)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n # 1605 = the release was already uninstalled\n if (($successCodes + 1605) -notcontains $process.ExitCode) {\n Write-Host \"Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)\"\n Exit $process.ExitCode\n }\n}\n\n$installProcess = Start-Process msiexec.exe `\n -ArgumentList \"/quiet /norestart /lv `\"${logFile}`\" /i `\"${env:INSTALLER_PATH}`\"\" `\n -PassThru -Verb RunAs -Wait\n\nGet-Content $logFile -Tail 500\n\nif ($successCodes -contains $installProcess.ExitCode) {\n Exit 0\n}\n\nExit $installProcess.ExitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", - "de9e823f": "# Uninstalls every QGIS release on the host, since each release installs side\n# by side under its own product code. QGIS LTR (3.44.x) is left in place.\n\n$ltrSeries = '3.44.'\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled.\n$successCodes = @(0, 3010, 1641, 1605)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\n\nif ($entries.Count -eq 0) {\n Write-Host \"No QGIS installation found.\"\n Exit 1\n}\n\n$exitCode = 0\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n Write-Host \"Uninstall exit code: $($process.ExitCode)\"\n if ($successCodes -notcontains $process.ExitCode) {\n $exitCode = $process.ExitCode\n }\n}\n\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + "37b1cac3": "# Uninstalls every QGIS release on the host, since each release installs side\n# by side under its own product code. QGIS LTR (3.44.x) is left in place.\n\n$ltrSeries = '3.44.'\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled.\n$successCodes = @(0, 3010, 1641, 1605)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\n\nif ($entries.Count -eq 0) {\n Write-Host \"No QGIS installation found; nothing to uninstall.\"\n Exit 0\n}\n\n$exitCode = 0\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n Write-Host \"Uninstall exit code: $($process.ExitCode)\"\n if ($successCodes -notcontains $process.ExitCode) {\n $exitCode = $process.ExitCode\n }\n}\n\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "b661d065": "# Each QGIS release installs side by side under its own product code, so\n# installed QGIS releases are uninstalled first. QGIS LTR (3.44.x) is left in place.\n\n$ltrSeries = '3.44.'\n$logFile = \"${env:TEMP}/fleet-install-software.log\"\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure.\n$successCodes = @(0, 3010, 1641)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n -not ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n # 1605 = the release was already uninstalled\n if (($successCodes + 1605) -notcontains $process.ExitCode) {\n Write-Host \"Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)\"\n Exit $process.ExitCode\n }\n}\n\n$installProcess = Start-Process msiexec.exe `\n -ArgumentList \"/quiet /norestart /lv `\"${logFile}`\" /i `\"${env:INSTALLER_PATH}`\"\" `\n -PassThru -Verb RunAs -Wait\n\nGet-Content $logFile -Tail 500\n\nif ($successCodes -contains $installProcess.ExitCode) {\n Exit 0\n}\n\nExit $installProcess.ExitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" } } diff --git a/ee/maintained-apps/outputs/qgis-ltr/darwin.json b/ee/maintained-apps/outputs/qgis@ltr/darwin.json similarity index 100% rename from ee/maintained-apps/outputs/qgis-ltr/darwin.json rename to ee/maintained-apps/outputs/qgis@ltr/darwin.json diff --git a/ee/maintained-apps/outputs/qgis-ltr/windows.json b/ee/maintained-apps/outputs/qgis@ltr/windows.json similarity index 83% rename from ee/maintained-apps/outputs/qgis-ltr/windows.json rename to ee/maintained-apps/outputs/qgis@ltr/windows.json index 27de868b91a..3d9efad1689 100644 --- a/ee/maintained-apps/outputs/qgis-ltr/windows.json +++ b/ee/maintained-apps/outputs/qgis@ltr/windows.json @@ -9,7 +9,7 @@ }, "installer_url": "https://qgis.org/downloads/QGIS-OSGeo4W-3.44.14-1.msi", "install_script_ref": "c1308e76", - "uninstall_script_ref": "c7c40f33", + "uninstall_script_ref": "6ce7e210", "sha256": "0a579f980dcec85be2ecb47c5f08234ca6ce7b625c3cb9543eded1f43d445b46", "default_categories": [ "Productivity" @@ -18,7 +18,7 @@ } ], "refs": { - "c1308e76": "# Each QGIS release installs side by side under its own product code, so\n# installed QGIS LTR (3.44.x) releases are uninstalled first. Other QGIS\n# releases are left in place.\n\n$ltrSeries = '3.44.'\n$logFile = \"${env:TEMP}/fleet-install-software.log\"\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure.\n$successCodes = @(0, 3010, 1641)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n # 1605 = the release was already uninstalled\n if (($successCodes + 1605) -notcontains $process.ExitCode) {\n Write-Host \"Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)\"\n Exit $process.ExitCode\n }\n}\n\n$installProcess = Start-Process msiexec.exe `\n -ArgumentList \"/quiet /norestart /lv `\"${logFile}`\" /i `\"${env:INSTALLER_PATH}`\"\" `\n -PassThru -Verb RunAs -Wait\n\nGet-Content $logFile -Tail 500\n\nif ($successCodes -contains $installProcess.ExitCode) {\n Exit 0\n}\n\nExit $installProcess.ExitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", - "c7c40f33": "# Uninstalls every QGIS LTR (3.44.x) release on the host, since each release\n# installs side by side under its own product code. Other QGIS releases are\n# left in place.\n\n$ltrSeries = '3.44.'\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled.\n$successCodes = @(0, 3010, 1641, 1605)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\n\nif ($entries.Count -eq 0) {\n Write-Host \"No QGIS LTR installation found.\"\n Exit 1\n}\n\n$exitCode = 0\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n Write-Host \"Uninstall exit code: $($process.ExitCode)\"\n if ($successCodes -notcontains $process.ExitCode) {\n $exitCode = $process.ExitCode\n }\n}\n\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + "6ce7e210": "# Uninstalls every QGIS LTR (3.44.x) release on the host, since each release\n# installs side by side under its own product code. Other QGIS releases are\n# left in place.\n\n$ltrSeries = '3.44.'\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED, 1605 = already uninstalled.\n$successCodes = @(0, 3010, 1641, 1605)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\n\nif ($entries.Count -eq 0) {\n Write-Host \"No QGIS LTR installation found; nothing to uninstall.\"\n Exit 0\n}\n\n$exitCode = 0\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n Write-Host \"Uninstall exit code: $($process.ExitCode)\"\n if ($successCodes -notcontains $process.ExitCode) {\n $exitCode = $process.ExitCode\n }\n}\n\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "c1308e76": "# Each QGIS release installs side by side under its own product code, so\n# installed QGIS LTR (3.44.x) releases are uninstalled first. Other QGIS\n# releases are left in place.\n\n$ltrSeries = '3.44.'\n$logFile = \"${env:TEMP}/fleet-install-software.log\"\n\n# MSI exit codes that indicate success. 3010 = ERROR_SUCCESS_REBOOT_REQUIRED,\n# 1641 = ERROR_SUCCESS_REBOOT_INITIATED. Treat these as success rather than failure.\n$successCodes = @(0, 3010, 1641)\n\ntry {\n\n$uninstallRoots = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n)\n$entries = @(Get-ItemProperty -Path $uninstallRoots -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like 'QGIS *' -and $_.Publisher -eq 'QGIS.org' -and\n ([string]$_.DisplayVersion).StartsWith($ltrSeries) -and\n $_.PSChildName -match '^\\{[0-9A-Fa-f-]+\\}$'\n})\nforeach ($entry in $entries) {\n Write-Host \"Uninstalling $($entry.DisplayName) ($($entry.PSChildName))\"\n $process = Start-Process msiexec.exe -ArgumentList \"/x $($entry.PSChildName) /qn /norestart\" -PassThru -Wait\n # 1605 = the release was already uninstalled\n if (($successCodes + 1605) -notcontains $process.ExitCode) {\n Write-Host \"Uninstall of $($entry.DisplayName) failed with exit code $($process.ExitCode)\"\n Exit $process.ExitCode\n }\n}\n\n$installProcess = Start-Process msiexec.exe `\n -ArgumentList \"/quiet /norestart /lv `\"${logFile}`\" /i `\"${env:INSTALLER_PATH}`\"\" `\n -PassThru -Verb RunAs -Wait\n\nGet-Content $logFile -Tail 500\n\nif ($successCodes -contains $installProcess.ExitCode) {\n Exit 0\n}\n\nExit $installProcess.ExitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" } } diff --git a/website/assets/images/app-icon-qgis-ltr-60x60@2x.png b/website/assets/images/app-icon-qgis@ltr-60x60@2x.png similarity index 100% rename from website/assets/images/app-icon-qgis-ltr-60x60@2x.png rename to website/assets/images/app-icon-qgis@ltr-60x60@2x.png From e288d4b928b79fea0ca331c335f092caf019a95a Mon Sep 17 00:00:00 2001 From: Allen Houchins Date: Tue, 6 Oct 2026 15:12:15 -0500 Subject: [PATCH 3/4] Drop QGIS LTR's per-build MSI UpgradeCode from its Windows FMA QGIS mints a new UpgradeCode for every MSI build. Fleet resolves a Windows FMA's software title by upgrade code, so each LTR update would land on a new "QGIS LTR" title (and GitOps would move the installer to it). Add an ignore_upgrade_code winget input that leaves the code out, and give QGIS LTR its own unique_identifier so its title stays distinct from QGIS. --- ee/maintained-apps/README.md | 1 + .../ingesters/winget/ingester.go | 9 +++++- .../ingesters/winget/ingester_test.go | 28 +++++++++++++++++++ .../inputs/winget/qgis@ltr.json | 3 +- ee/maintained-apps/outputs/apps.json | 2 +- .../outputs/qgis@ltr/windows.json | 3 +- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/ee/maintained-apps/README.md b/ee/maintained-apps/README.md index 38db09254f4..507671610b1 100644 --- a/ee/maintained-apps/README.md +++ b/ee/maintained-apps/README.md @@ -124,6 +124,7 @@ go run cmd/maintained-apps/main.go --slug="box-drive/windows" --debug | `install_script_path` | string | Filepath to a custom install script (`.ps1`). Overrides the generated install script. Script must be placed in `inputs/winget/scripts/`. For `.msi` apps, the ingestor automatically generates install scripts. Do not add scripts unless you need to override the generated behavior. For `.exe` apps, you must provide PowerShell scripts that run the installer file directly. Fleet stores the installer and sends it to the host at install time; your script must execute it using the `INSTALLER_PATH` environment variable. | | `uninstall_script_path` | string | Filepath to a custom uninstall script (`.ps1`). Overrides the generated uninstall script. Script must be placed in `inputs/winget/scripts/`. For `.msi` apps, the ingestor automatically generates uninstall scripts. Do not add scripts unless you need to override the generated behavior. For `.exe` apps, you must provide a script to uninstall the app. Scripts for `.exe` apps are vendor-specific. Use the vendor’s documented silent uninstall switch or the registered UninstallString (if available), ensuring the script runs silently and returns the installer’s exit code. | | `fuzzy_match_name` | boolean | If the `unique_identifier` doesn't match the `DisplayName`, use `fuzzy_match_name` to specify that Fleet uses "fuzzy matching" to match the Fleet-maintained app and the inventoried software. For example, for Pritunl, the `unique_identifier` is "Pritunl" and the inventories software's `DisplayName` is "Pritunl Client". With `fuzzy_match_name` set to true, Pritunl app will be matched to the inventories software. | +| `ignore_upgrade_code` | boolean | Set to `true` when the vendor gives every MSI build a new `UpgradeCode` (e.g., QGIS). Fleet links a Windows Fleet-maintained app to its software title by upgrade code, so a per-build code would move the app to a new title with each update. With this set, the title is linked by `unique_identifier` instead, so give each app that sets it a distinct `unique_identifier`. | | `requires_client_os` | boolean | Set to `true` when the installer refuses to run on Windows Server SKUs (e.g., Dell Display and Peripheral Manager). Fleet's ingestion ignores this field; CI reads it to route validation to the `windows-11-arm` runner (the only GitHub-hosted client-OS Windows runner) instead of the default Windows Server x64 runner. | #### Windows troubleshooting diff --git a/ee/maintained-apps/ingesters/winget/ingester.go b/ee/maintained-apps/ingesters/winget/ingester.go index 19a96586ee3..7e6c0b005fa 100644 --- a/ee/maintained-apps/ingesters/winget/ingester.go +++ b/ee/maintained-apps/ingesters/winget/ingester.go @@ -382,6 +382,9 @@ func (i *wingetIngester) ingestOne(ctx context.Context, input inputApp) (*mainta } } } + if input.IgnoreUpgradeCode { + upgradeCode = "" + } if uninstallScript == "" && upgradeCode != "" { var err error uninstallScript, err = buildUpgradeCodeBasedUninstallScript(upgradeCode) @@ -657,7 +660,11 @@ type inputApp struct { // (e.g. python.org installers report "3.14.5150.0" for version "3.14.5"). UseDisplayVersionForPatch bool `json:"use_display_version_for_patch"` // Whether to use "no_check" instead of the app's hash (e.g. for non-pinned download URLs) - IgnoreHash bool `json:"ignore_hash"` + IgnoreHash bool `json:"ignore_hash"` + // IgnoreUpgradeCode leaves the MSI UpgradeCode out of the manifest, for apps that mint + // a new one every build (e.g. QGIS). Fleet resolves a Windows FMA's software title by + // its upgrade code, so a per-build code would move the app to a new title on each update. + IgnoreUpgradeCode bool `json:"ignore_upgrade_code"` DefaultCategories []string `json:"default_categories"` Frozen bool `json:"frozen"` PatchPolicyPath string `json:"patch_policy_path"` diff --git a/ee/maintained-apps/ingesters/winget/ingester_test.go b/ee/maintained-apps/ingesters/winget/ingester_test.go index 4d54a81950b..05d94608feb 100644 --- a/ee/maintained-apps/ingesters/winget/ingester_test.go +++ b/ee/maintained-apps/ingesters/winget/ingester_test.go @@ -464,6 +464,29 @@ func TestIngestValidations(t *testing.T) { upgradeCode: "{ABCDEF}", }, }, + { + name: "ignore upgrade code", + inputApp: inputApp{ + Name: "Foo", + UniqueIdentifier: "Foo", + PackageIdentifier: "Foo", + InstallerArch: "x64", + Slug: "foo/windows", + InstallScriptPath: path.Join(tempDir, "install_script.ps1"), + UninstallScriptPath: path.Join(tempDir, "uninstall_script.ps1"), + InstallerType: "msi", + InstallerScope: "machine", + IgnoreUpgradeCode: true, + }, + cfg: serverConfig{ + productCode: "{ABCDEF}", + installerType: "msi", + installerScope: "machine", + installerArch: "x64", + installerProdCode: "{ACBDEF}", + upgradeCode: "{ABCDEF}", + }, + }, { name: "wrong installer type", wantErr: "failed to find installer for app", @@ -516,6 +539,11 @@ func TestIngestValidations(t *testing.T) { if c.wantPatchedContains != "" { require.Contains(t, out.Queries.Patched, c.wantPatchedContains) } + if c.inputApp.IgnoreUpgradeCode { + require.Empty(t, out.UpgradeCode) + } else { + require.Equal(t, c.cfg.upgradeCode, out.UpgradeCode) + } // The managed "is app open" query matches a process named ".exe". require.Equal(t, "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM processes WHERE LOWER(name) = 'foo.exe');", diff --git a/ee/maintained-apps/inputs/winget/qgis@ltr.json b/ee/maintained-apps/inputs/winget/qgis@ltr.json index e02a7b43440..9b6a602c3a9 100644 --- a/ee/maintained-apps/inputs/winget/qgis@ltr.json +++ b/ee/maintained-apps/inputs/winget/qgis@ltr.json @@ -2,12 +2,13 @@ "name": "QGIS LTR", "slug": "qgis@ltr/windows", "package_identifier": "OSGeo.QGIS_LTR", - "unique_identifier": "QGIS", + "unique_identifier": "QGIS LTR", "fuzzy_match_name": true, "exists_query": "SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version LIKE '3.44.%';", "installer_arch": "x64", "installer_type": "msi", "installer_scope": "machine", + "ignore_upgrade_code": true, "install_script_path": "ee/maintained-apps/inputs/winget/scripts/qgis-ltr_install.ps1", "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/qgis-ltr_uninstall.ps1", "default_categories": ["Productivity"] diff --git a/ee/maintained-apps/outputs/apps.json b/ee/maintained-apps/outputs/apps.json index 1f9a186c490..55c08f1d151 100644 --- a/ee/maintained-apps/outputs/apps.json +++ b/ee/maintained-apps/outputs/apps.json @@ -7222,7 +7222,7 @@ "name": "QGIS LTR", "slug": "qgis@ltr/windows", "platform": "windows", - "unique_identifier": "QGIS", + "unique_identifier": "QGIS LTR", "description": "QGIS LTR is the long-term release of QGIS, a free and open-source geographic information system (GIS) for viewing, editing, and analyzing geospatial data." }, { diff --git a/ee/maintained-apps/outputs/qgis@ltr/windows.json b/ee/maintained-apps/outputs/qgis@ltr/windows.json index 3d9efad1689..2135eab5c88 100644 --- a/ee/maintained-apps/outputs/qgis@ltr/windows.json +++ b/ee/maintained-apps/outputs/qgis@ltr/windows.json @@ -13,8 +13,7 @@ "sha256": "0a579f980dcec85be2ecb47c5f08234ca6ce7b625c3cb9543eded1f43d445b46", "default_categories": [ "Productivity" - ], - "upgrade_code": "{C9417C88-E128-1014-9195-A75173304312}" + ] } ], "refs": { From c8739a7692de586b51652f1ca7298f98ff2d8795 Mon Sep 17 00:00:00 2001 From: Allen Houchins <allenhouchins@mac.com> Date: Thu, 8 Oct 2026 12:46:41 -0500 Subject: [PATCH 4/4] Match Windows FMAs by their exists query in the validator QGIS LTR's registry DisplayName ("QGIS 3.44.14 'Solothurn'") contains neither its catalog name nor its unique_identifier ("QGIS LTR"), so the Windows validator never found it after install. Also search programs with the manifest's exists query, which is how Fleet detects the app. --- cmd/maintained-apps/validate/app_commander.go | 3 +- cmd/maintained-apps/validate/darwin.go | 2 +- cmd/maintained-apps/validate/main.go | 15 +++++++++- cmd/maintained-apps/validate/main_test.go | 28 +++++++++++++++++++ cmd/maintained-apps/validate/windows.go | 9 +++++- 5 files changed, 53 insertions(+), 4 deletions(-) diff --git a/cmd/maintained-apps/validate/app_commander.go b/cmd/maintained-apps/validate/app_commander.go index 7fdd5606edf..fab0afc4db5 100644 --- a/cmd/maintained-apps/validate/app_commander.go +++ b/cmd/maintained-apps/validate/app_commander.go @@ -19,6 +19,7 @@ type AppCommander struct { Name string Slug string UniqueIdentifier string + ExistsQuery string Version string AppPath string UninstallScript string @@ -94,7 +95,7 @@ func (ac *AppCommander) uninstallApp(ctx context.Context) bool { } ac.appLogger.DebugContext(ctx, fmt.Sprintf("Output: %s", output)) - existance, err := appExists(ctx, ac.appLogger, ac.Name, ac.UniqueIdentifier, ac.Version, ac.AppPath) + existance, err := appExists(ctx, ac.appLogger, ac.Name, ac.UniqueIdentifier, ac.Version, ac.AppPath, ac.ExistsQuery) if err != nil { ac.appLogger.ErrorContext(ctx, fmt.Sprintf("Error checking if app exists after uninstall: %v", err)) return false diff --git a/cmd/maintained-apps/validate/darwin.go b/cmd/maintained-apps/validate/darwin.go index 6a1d002af05..8517038c6e5 100644 --- a/cmd/maintained-apps/validate/darwin.go +++ b/cmd/maintained-apps/validate/darwin.go @@ -176,7 +176,7 @@ func checkVersionMatch(expectedVersion, foundVersion, foundBundledVersion string return false } -func appExists(ctx context.Context, logger *slog.Logger, appName, uniqueAppIdentifier, appVersion, appPath string) (bool, error) { +func appExists(ctx context.Context, logger *slog.Logger, appName, uniqueAppIdentifier, appVersion, appPath, _ string) (bool, error) { execTimeout, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() diff --git a/cmd/maintained-apps/validate/main.go b/cmd/maintained-apps/validate/main.go index 3f1124e1bd6..d5acf8bfef7 100644 --- a/cmd/maintained-apps/validate/main.go +++ b/cmd/maintained-apps/validate/main.go @@ -149,6 +149,7 @@ func run(cfg *Config) error { ac.Name = app.Name ac.Slug = app.Slug ac.UniqueIdentifier = app.UniqueIdentifier + ac.ExistsQuery = maintainedApp.AutomaticInstallQuery // default version to maintained app version ac.Version = maintainedApp.Version ac.InstallScript = maintainedApp.InstallScript @@ -240,7 +241,7 @@ func run(cfg *Config) error { warnApp() } - existance, err := appExists(ctx, appLogger, ac.Name, ac.UniqueIdentifier, ac.Version, ac.AppPath) + existance, err := appExists(ctx, appLogger, ac.Name, ac.UniqueIdentifier, ac.Version, ac.AppPath, ac.ExistsQuery) if err != nil { appLogger.ErrorContext(ctx, fmt.Sprintf("Error checking if app exists: %v", err)) appWithError = append(appWithError, ac.Name) @@ -493,3 +494,15 @@ func validateSqlInput(input string) error { return nil } + +var programsExistsQueryRegex = regexp.MustCompile(`(?is)^\s*SELECT\s+1\s+FROM\s+programs\s+WHERE\s+(.+?);?\s*$`) + +// programsExistsWhereClause returns the WHERE clause of an exists query shaped +// "SELECT 1 FROM programs WHERE ...", or "" for any other shape. +func programsExistsWhereClause(existsQuery string) string { + m := programsExistsQueryRegex.FindStringSubmatch(existsQuery) + if m == nil { + return "" + } + return m[1] +} diff --git a/cmd/maintained-apps/validate/main_test.go b/cmd/maintained-apps/validate/main_test.go index 312814731f7..bd800808a64 100644 --- a/cmd/maintained-apps/validate/main_test.go +++ b/cmd/maintained-apps/validate/main_test.go @@ -126,3 +126,31 @@ func TestValidateSqlInput(t *testing.T) { }) } } + +func TestProgramsExistsWhereClause(t *testing.T) { + testCases := []struct { + query string + want string + }{ + {"", ""}, + { + "SELECT 1 FROM programs WHERE name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version LIKE '3.44.%';", + "name LIKE 'QGIS %' AND publisher = 'QGIS.org' AND version LIKE '3.44.%'", + }, + { + "select 1 from programs where name = 'Foo'", + "name = 'Foo'", + }, + { + "SELECT 1 FROM apps WHERE bundle_identifier = 'com.example.foo';", + "", + }, + { + "SELECT 1 WHERE EXISTS (SELECT 1 FROM programs WHERE name = 'Foo') OR NOT EXISTS (SELECT 1 FROM system_info WHERE cpu_type LIKE 'ARM%');", + "", + }, + } + for _, tc := range testCases { + require.Equal(t, tc.want, programsExistsWhereClause(tc.query), tc.query) + } +} diff --git a/cmd/maintained-apps/validate/windows.go b/cmd/maintained-apps/validate/windows.go index 0bc45cde68f..d2e5c639d7f 100644 --- a/cmd/maintained-apps/validate/windows.go +++ b/cmd/maintained-apps/validate/windows.go @@ -39,7 +39,7 @@ func normalizeVersion(version string) string { return strings.Join(parts, ".") } -func appExists(ctx context.Context, logger *slog.Logger, appName, uniqueIdentifier, appVersion, appPath string) (bool, error) { +func appExists(ctx context.Context, logger *slog.Logger, appName, uniqueIdentifier, appVersion, appPath, existsQuery string) (bool, error) { execTimeout, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() @@ -70,6 +70,13 @@ func appExists(ctx context.Context, logger *slog.Logger, appName, uniqueIdentifi if appPath != "" { query += fmt.Sprintf(" OR install_location LIKE '%%%s%%'", appPath) } + // Some DisplayNames contain neither the catalog name nor the + // unique_identifier (e.g. QGIS LTR installs as "QGIS 3.44.14 'Solothurn'"), + // so also match the manifest's exists query, which is how Fleet detects the + // app. It comes from the manifest, so it isn't run through validateSqlInput. + if clause := programsExistsWhereClause(existsQuery); clause != "" { + query += ` OR (` + clause + `)` + } cmd := exec.CommandContext(execTimeout, "osqueryi", "--json", query) output, err := cmd.CombinedOutput() if err != nil {