Opened 10 months ago

Last modified 8 months ago

#804 closed defect

Could not load qgis_app.dll - QGIS LTR 3.28.11 OSGeo4W Installer — at Version 2

Reported by: ascottwwf Owned by: osgeo4w-dev@…
Priority: normal Component: Installer
Version: 1.0 Keywords: QGIS LTR OSGeo4W scripted installer
Cc: ascottwwf

Description (last modified by ascottwwf)

I tried raising this issue with QGIS but I was pointed in your direction.

What is the bug or the crash?

After either a fresh install (or an upgrade install) of QGIS LTR using the OSGeo4W installer, the QGIS application will not start as it errors with:

QGIS Install Error

Steps to reproduce the issue

We deploy QGIS LTR to a small number of users using Intune as our Application deployment method, this is deployed using a PowerShell script (originally sourced from: https://gist.github.com/Guts/6303dc5eb941eb24be3e27609cd46985), my slightly modified script is as follows:

"Begin: $ENV:PROCESSOR_ARCHITECTURE" >> "C:\Windows\Temp\Test.txt"
If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") {
     Try {
         &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH
     }
     Catch {
         Throw "Failed to start $PSCOMMANDPATH"
     }
     Exit
}

"End: $ENV:PROCESSOR_ARCHITECTURE" >> "C:\Windows\Temp\Test.txt"
#Requires -RunAsAdministrator

<#
=========================================================================================
Install-OSGeo4W_QGIS-LTR.ps1
-----------------------------
.Synopsis
   Download the OSGeo4W installer then download and install QGIS LTR (through the 'full' meta-package).
.DESCRIPTION
   This script will:
      1. change the current directory to the user downloads folder
      2. download the OSGeo4W installer
      3. launch it passing command-line parameters to INSTALL QGIS LTR
    Documentation reference: https://trac.osgeo.org/osgeo4w/wiki/CommandLine
#>

<#
=========================================================================================
Adrian Scott
7th December 2022

Original file sourced from: https://gist.github.com/Guts/6303dc5eb941eb24be3e27609cd46985

=========================================================================================
#>

Write-Host "=== Start installing / upgrading QGIS LTR..." -ForegroundColor Green

# Save current working directory
$starter_path = Get-Location

# Move into the user download directory
Set-Location -Path "$($env:USERPROFILE)\Downloads"

# Set saved name of File to be downloaded
$OutFile = "osgeo4w-setup.exe"

# Download installer
Write-Host " = Start downloading the OSGeo4W installer..." -ForegroundColor Yellow
Invoke-WebRequest -Uri "https://download.osgeo.org/osgeo4w/v2/osgeo4w-setup.exe" -OutFile $OutFile

# Download and install (same command to upgrade with clean up)
Write-Host " = Start installing / upgrading QGIS LTR..." -ForegroundColor Yellow
& .\$($OutFile) `
    --quiet-mode `
    --advanced `
    --arch x86_64 `
    --autoaccept `
    --delete-orphans `
    --local-package-dir "$($env:APPDATA)\OSGeo4W_v2-Packages" `
    --menu-name "QGIS LTR" `
    --no-desktop `
    --packages qgis-ltr-full `
    --root "$($env:ProgramFiles)\OSGeo4W_v2" `
    --site "https://www.norbit.de/osgeo4w/v2" `
    --site "https://download.osgeo.org/osgeo4w/v2" `
    --site "https://ftp.osuosl.org/pub/osgeo/download/osgeo4w/v2" `
    --upgrade-also `
 | out-null

# Return to the initial directory
Set-Location -Path $starter_path
Write-Host "==== Work is done!" -ForegroundColor Green

So, up until the release of QGIS LTR version 3.28.9 (or 3.28.8), this script had worked fine, but since then we have been seeing this issue

This issue occurs on both fresh installs and upgrade installs (this is similar to the earlier reported QGIS issue #49148 (https://github.com/qgis/QGIS/issues/49148). We use the OSGeo4W installer to install (and/or upgrade) QGIS LTR

From my basic understanding it appears that during the install, the path environment does not get updated (as it had previously), so when running the QGIS application the qgis_app.dll can not be found, hence the error message. I also note that on a new and upgraded install that the qgis-ltr-bin.env file does not exist so it is not possible to Check this file for correct environment paths. I have re-visited the command line syntax for the OSGeo4W installer (https://trac.osgeo.org/osgeo4w/wiki/CommandLine), to double check there is no changes to the syntax (or mistakes in my command), but all seems as it always has. FYI: All our devices run Windows 10 Enterprise (x64) version 22H2 with latest September (or August) 2023 Windows updates installed i.e. Build 10.0.19045.3348

I suspect the installer is failing to complete at some point and not running the procedure that amends the environment path

Change History (3)

by ascottwwf, 10 months ago

Attachment: QGIS Install Error.png added

QGIS Install Error

comment:1 by ascottwwf, 10 months ago

Description: modified (diff)

comment:2 by ascottwwf, 10 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.