Skip to content

Commit cac9b75

Browse files
alltheseasclaude
andcommitted
fix: install to 64-bit Program Files on Windows
The Inno Setup installer used {pf} which resolves to Program Files (x86), causing CreateProcess error 216 (architecture mismatch) when launching the 64-bit notedeck.exe. - Switch to {autopf} and add ArchitecturesAllowed/InstallIn64BitMode - Conditionally emit arm64 directives for aarch64 builds - Remove duplicated inline .iss generation from CI workflow; use the shared scripts/windows-installer.iss via /DBuildArch instead - Remove redundant untargeted cargo build step - Remove no-op Move-Item step (OutputDir already writes to packages\arch) Closes #1298 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ee63039 commit cac9b75

File tree

2 files changed

+23
-40
lines changed

2 files changed

+23
-40
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ jobs:
207207
- name: Rust cache
208208
uses: Swatinem/rust-cache@v2
209209

210-
# Build
211-
- name: Build (Native Only)
212-
run: cargo build --release
213-
214210
# Create packages directory
215211
- name: Create packages directory
216212
run: mkdir packages
@@ -231,43 +227,11 @@ jobs:
231227
Write-Output "Building for target: $target"
232228
cargo build --release --target=$target
233229
234-
# Generate ISS Script
235-
- name: Generate Inno Setup Script
236-
shell: pwsh
237-
run: |
238-
$arch = "${{ matrix.arch }}"
239-
$issContent = @"
240-
[Setup]
241-
AppName=Damus Notedeck
242-
AppVersion=0.1
243-
DefaultDirName={pf}\Notedeck
244-
DefaultGroupName=Damus Notedeck
245-
OutputDir=..\packages\$arch
246-
OutputBaseFilename=DamusNotedeckInstaller
247-
Compression=lzma
248-
SolidCompression=yes
249-
250-
[Files]
251-
Source: "..\target\$arch-pc-windows-msvc\release\notedeck.exe"; DestDir: "{app}"; Flags: ignoreversion
252-
253-
[Icons]
254-
Name: "{group}\Damus Notedeck"; Filename: "{app}\notedeck.exe"
255-
256-
[Run]
257-
Filename: "{app}\notedeck.exe"; Description: "Launch Damus Notedeck"; Flags: nowait postinstall skipifsilent
258-
"@
259-
Set-Content -Path "scripts/windows-installer-$arch.iss" -Value $issContent
260-
261230
# Build Installer
262231
- name: Run Inno Setup Script
263232
run: |
264-
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "scripts\windows-installer-${{ matrix.arch }}.iss"
233+
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DBuildArch=${{ matrix.arch }} "scripts\windows-installer.iss"
265234
266-
# Move output
267-
- name: Move Inno Script outputs to architecture-specific folder
268-
run: |
269-
New-Item -ItemType Directory -Force -Path packages\${{ matrix.arch }}
270-
Move-Item -Path packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe -Destination packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe
271235
# Upload the installer as an artifact
272236
- name: Upload Installer
273237
uses: actions/upload-artifact@v4

scripts/windows-installer.iss

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
1+
#ifndef BuildArch
2+
#define BuildArch ""
3+
#endif
4+
5+
#if BuildArch != ""
6+
#define ExeSource "..\target\" + BuildArch + "-pc-windows-msvc\release\notedeck.exe"
7+
#define PkgOutputDir "..\packages\" + BuildArch
8+
#else
9+
#define ExeSource "..\target\release\notedeck.exe"
10+
#define PkgOutputDir "..\packages"
11+
#endif
12+
113
[Setup]
214
AppName=Damus Notedeck
315
AppVersion=0.1
4-
DefaultDirName={pf}\Notedeck
16+
DefaultDirName={autopf}\Notedeck
517
DefaultGroupName=Damus Notedeck
6-
OutputDir=..\packages
18+
OutputDir={#PkgOutputDir}
719
OutputBaseFilename=DamusNotedeckInstaller
820
Compression=lzma
921
SolidCompression=yes
22+
#if BuildArch == "aarch64"
23+
ArchitecturesAllowed=arm64
24+
ArchitecturesInstallIn64BitMode=arm64
25+
#else
26+
ArchitecturesAllowed=x64compatible
27+
ArchitecturesInstallIn64BitMode=x64compatible
28+
#endif
1029

1130
[Files]
12-
Source: "..\target\release\notedeck.exe"; DestDir: "{app}"; Flags: ignoreversion
31+
Source: "{#ExeSource}"; DestDir: "{app}"; Flags: ignoreversion
1332

1433
[Icons]
1534
Name: "{group}\Damus Notedeck"; Filename: "{app}\notedeck.exe"

0 commit comments

Comments
 (0)