38 | | WWF-UK version |
39 | | -------------- |
40 | | Adrian Scott |
41 | | 7th December 2022 |
42 | | |
43 | | Original file sourced from: https://gist.github.com/Guts/6303dc5eb941eb24be3e27609cd46985 |
44 | | |
45 | | ========================================================================================= |
46 | | #> |
47 | | |
48 | | Write-Host "=== Start installing / upgrading QGIS LTR..." -ForegroundColor Green |
49 | | |
50 | | # Save current working directory |
51 | | $starter_path = Get-Location |
52 | | |
53 | | # Move into the user download directory |
54 | | Set-Location -Path "$($env:USERPROFILE)\Downloads" |
55 | | |
56 | | # Set saved name of File to be downloaded |
57 | | $OutFile = "osgeo4w-setup.exe" |
58 | | |
59 | | # Download installer |
60 | | Write-Host " = Start downloading the OSGeo4W installer..." -ForegroundColor Yellow |
61 | | Invoke-WebRequest -Uri "https://download.osgeo.org/osgeo4w/v2/osgeo4w-setup.exe" -OutFile $OutFile |
62 | | |
63 | | # Download and install (same command to upgrade with clean up) |
64 | | Write-Host " = Start installing / upgrading QGIS LTR..." -ForegroundColor Yellow |
65 | | & .\$($OutFile) ` |
66 | | --quiet-mode ` |
67 | | --advanced ` |
68 | | --arch x86_64 ` |
69 | | --autoaccept ` |
70 | | --delete-orphans ` |
71 | | --local-package-dir "$($env:APPDATA)\OSGeo4W_v2-Packages" ` |
72 | | --menu-name "QGIS LTR" ` |
73 | | --no-desktop ` |
74 | | --packages qgis-ltr-full ` |
75 | | --root "$($env:ProgramData)\OSGeo4W_v2" ` |
76 | | --site "https://www.norbit.de/osgeo4w/v2" ` |
77 | | --site "https://download.osgeo.org/osgeo4w/v2" ` |
78 | | --site "https://ftp.osuosl.org/pub/osgeo/download/osgeo4w/v2" ` |
79 | | --upgrade-also ` |
80 | | | out-null |
81 | | |
82 | | # Return to the initial directory |
83 | | Set-Location -Path $starter_path |
84 | | Write-Host "==== Work is done!" -ForegroundColor Green |
85 | | }}} |
86 | | |
87 | | I will attach the new log files from the Sandbox for further investigationSorry for the delay, I have not been able to get version 3.28.11 to successfully run after completing a fresh install in my Sandbox, I get the same error message as before. |
88 | | |
89 | | As I was wondering if it was related to the install path having a space in it, as a test I modified my install script (Changed '--root' (destination path) from "C:\Program Files\OSGeo4W_v2" to "C:\ProgramData\OSGeo4W_v2" |
90 | | |
91 | | My full (PowerShell) install script is now: |
92 | | |
93 | | {{{ |
94 | | "Begin: $ENV:PROCESSOR_ARCHITECTURE" >> "C:\Windows\Temp\Test.txt" |
95 | | If ($ENV:PROCESSOR_ARCHITEW6432 -eq "AMD64") { |
96 | | Try { |
97 | | &"$ENV:WINDIR\SysNative\WindowsPowershell\v1.0\PowerShell.exe" -File $PSCOMMANDPATH |
98 | | } |
99 | | Catch { |
100 | | Throw "Failed to start $PSCOMMANDPATH" |
101 | | } |
102 | | Exit |
103 | | } |
104 | | |
105 | | "End: $ENV:PROCESSOR_ARCHITECTURE" >> "C:\Windows\Temp\Test.txt" |
106 | | #Requires -RunAsAdministrator |
107 | | |
108 | | <# |
109 | | ========================================================================================= |
110 | | Install-OSGeo4W_QGIS-LTR.ps1 |
111 | | ----------------------------- |
112 | | .Synopsis |
113 | | Download the OSGeo4W installer then download and install QGIS LTR (through the 'full' meta-package). |
114 | | .DESCRIPTION |
115 | | This script will: |
116 | | 1. change the current directory to the user downloads folder |
117 | | 2. download the OSGeo4W installer |
118 | | 3. launch it passing command-line parameters to INSTALL QGIS LTR |
119 | | Documentation reference: https://trac.osgeo.org/osgeo4w/wiki/CommandLine |
120 | | #> |
121 | | |
122 | | <# |
123 | | ========================================================================================= |
124 | | WWF-UK version |
125 | | -------------- |