Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ jobs:
"3.14t",
"3.14",
"3.13",
"3.12",
]
architecture: ["x64"]
os: ["windows-latest"]
include:
# Test the next oldest Python on ARM64
- { python-version: "3.12", architecture: "arm64", os: "windows-11-arm" }
# Test the oldest Python on 32-bit
- { python-version: "3.11", architecture: "x86", os: "windows-2022" }

Expand Down Expand Up @@ -102,10 +103,10 @@ jobs:
choco install nasm --no-progress
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH

choco install ghostscript --no-progress
foreach ($dir in (Get-ChildItem -Path "C:\Program Files\gs\gs*\bin")) {
echo $dir.FullName >> $env:GITHUB_PATH
}
# "choco install ghostscript" hangs on ARM64, so extract instead
gh release download -R ArtifexSoftware/ghostpdl-downloads --pattern "gs*w64.exe" --output gs.exe
7z x -y gs.exe -oC:\gs > $null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a silly question, but why use 7z here? Is gs.exe actually compressed in the last step and this is expanding it, or is there some Windows convention I'm unaware of where 7z can be used to run exes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an NSIS installer:

❯ gh release download -R ArtifexSoftware/ghostpdl-downloads --pattern "gs*w64.exe" --output gs.exe
❯ file gs.exe
gs.exe: PE32 executable (GUI) Intel 80386, for MS Windows, Nullsoft Installer self-extracting archive

And 7z knows how to extract NSIS, it's listed under "Unpacking only" at https://www.7-zip.org. 7z x only extracts, not installs: https://7-zip.opensource.jp/chm/cmdline/commands/extract_full.htm We don't need to run the installer, just get the files in the right place.

See also https://salivity.github.io/7-zip/article/can-7-zip-extract-setup-exe-payloads

History corner: NSIS was first developed for Winamp :)

https://en.wikipedia.org/wiki/Nullsoft#Nullsoft_Scriptable_Install_System

echo "C:\gs\bin" >> $env:GITHUB_PATH

# Install extra test images
xcopy /S /Y Tests\test-images\* Tests\images
Expand All @@ -114,6 +115,8 @@ jobs:
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" `
| find """catalog_buildVersion""" `
| ForEach-Object { $a = $_.split(" ")[1]; echo "vs=$a" >> $env:GITHUB_OUTPUT }
env:
GH_TOKEN: ${{ github.token }}
shell: pwsh

- name: Cache build
Expand Down
Loading