Read the machine architecture, not the process's, in the launcher

The platform check read PROCESSOR_ARCHITECTURE, which a WOW64 process reports as
x86. Starting Luminary from the setup's finish page therefore stopped on 64-bit
Windows with "Luminary ships a 64-bit runtime; this PC reports 'x86'". The
machine architecture now comes from PROCESSOR_ARCHITEW6432 and
Is64BitOperatingSystem.
This commit is contained in:
2026-12-02 16:23:12 +00:00
parent 5b4b49200c
commit 5f15b528f4
2 changed files with 28 additions and 2 deletions
+7
View File
@@ -29,6 +29,13 @@ alongside 0.5.4; macOS remains at 0.5.1.
### Fixed ### Fixed
- **The launcher no longer rejects a 64-bit PC started from a 32-bit parent.**
The platform check read `PROCESSOR_ARCHITECTURE`, which a WOW64 process reports
as `x86`. Starting Luminary from the setup's own finish page (a 32-bit NSIS
process) therefore stopped at "Luminary ships a 64-bit runtime; this PC reports
'x86'" on ordinary 64-bit Windows. It now reads the machine architecture from
`PROCESSOR_ARCHITEW6432` and `Is64BitOperatingSystem`, so launch context no
longer changes the answer.
- **The setup now starts Luminary when "Start Luminary" is ticked.** The finish - **The setup now starts Luminary when "Start Luminary" is ticked.** The finish
page ran the launcher with NSIS `Exec`, which passes the path straight to page ran the launcher with NSIS `Exec`, which passes the path straight to
`CreateProcess`. This build ships the PowerShell launcher, so the target was `CreateProcess`. This build ships the PowerShell launcher, so the target was
+21 -2
View File
@@ -239,6 +239,25 @@ function Get-WindowsBuild {
# node.exe ships with it (and -Repair re-downloads it), libvips needs only the # node.exe ships with it (and -Repair re-downloads it), libvips needs only the
# Universal C Runtime that Windows 10/11 already has, and no admin rights are # Universal C Runtime that Windows 10/11 already has, and no admin rights are
# involved. Verified against the PE imports of node.exe and libvips-42.dll. # involved. Verified against the PE imports of node.exe and libvips-42.dll.
# The architecture of the machine, not of this process. Started from a 32-bit
# parent - the setup's finish page, or a SysWOW64 shell - a 64-bit PC still
# reports PROCESSOR_ARCHITECTURE=x86; the real value is in the WOW64 copy, and
# Is64BitOperatingSystem settles it.
function Get-MachineArch {
$arch = $env:PROCESSOR_ARCHITEW6432
if (-not $arch) { $arch = $env:PROCESSOR_ARCHITECTURE }
$is64 = $false
try { $is64 = [Environment]::Is64BitOperatingSystem } catch { }
if (-not $arch) { $arch = if ($is64) { 'AMD64' } else { 'x86' } }
if ($is64) {
if ($arch -eq 'x86') { $arch = 'AMD64' }
} elseif ($arch -eq 'AMD64' -or $arch -eq 'ARM64') {
# The OS says 32-bit; believe it rather than a stale variable.
$arch = 'x86'
}
return $arch
}
function Test-Platform { function Test-Platform {
$problems = @() $problems = @()
$notes = @() $notes = @()
@@ -248,7 +267,7 @@ function Test-Platform {
$problems += ("Luminary needs Windows 10 or 11. This PC reports build {0}." -f $build) $problems += ("Luminary needs Windows 10 or 11. This PC reports build {0}." -f $build)
} }
$arch = $env:PROCESSOR_ARCHITECTURE $arch = Get-MachineArch
if ($arch -and $arch -ne 'AMD64' -and $arch -ne 'ARM64') { if ($arch -and $arch -ne 'AMD64' -and $arch -ne 'ARM64') {
$problems += ("Luminary ships a 64-bit runtime; this PC reports '{0}'." -f $arch) $problems += ("Luminary ships a 64-bit runtime; this PC reports '{0}'." -f $arch)
} elseif ($arch -eq 'ARM64') { } elseif ($arch -eq 'ARM64') {
@@ -521,7 +540,7 @@ if ($Status) {
Write-Host 'Luminary is not running.' Write-Host 'Luminary is not running.'
} }
$platform = Test-Platform $platform = Test-Platform
Write-Host ("System: Windows build {0}, {1}" -f (Get-WindowsBuild), $env:PROCESSOR_ARCHITECTURE) Write-Host ("System: Windows build {0}, {1}" -f (Get-WindowsBuild), (Get-MachineArch))
foreach ($note in $platform.notes) { Write-Host ("Note: {0}" -f $note) } foreach ($note in $platform.notes) { Write-Host ("Note: {0}" -f $note) }
foreach ($problem in $platform.problems) { Write-Host ("Problem: {0}" -f $problem) } foreach ($problem in $platform.problems) { Write-Host ("Problem: {0}" -f $problem) }
$node = Resolve-Node $node = Resolve-Node