Skip to content

Comments

Fix Windows installer to use 64-bit Program Files#1299

Open
alltheseas wants to merge 1 commit intodamus-io:masterfrom
alltheseas:fix/windows-installer-64bit
Open

Fix Windows installer to use 64-bit Program Files#1299
alltheseas wants to merge 1 commit intodamus-io:masterfrom
alltheseas:fix/windows-installer-64bit

Conversation

@alltheseas
Copy link
Contributor

@alltheseas alltheseas commented Feb 20, 2026

Summary

  • Fix Inno Setup installer using {pf} (32-bit Program Files) instead of {autopf} (auto-detecting 64-bit)
  • Add ArchitecturesAllowed=x64compatible and ArchitecturesInstallIn64BitMode=x64compatible to ensure proper 64-bit installation
  • This resolves CreateProcess error 216 (architecture mismatch) on Windows 11

Closes #1298

Test plan

  • Build the installer with Inno Setup and verify it targets C:\Program Files\Notedeck on 64-bit Windows
  • Verify notedeck.exe launches successfully after installation

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Enhanced Windows installer with proper 64-bit architecture support
    • Installer now automatically launches the application upon successful installation completion
    • Streamlined installer build process for more reliable deployments

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Warning

Rate limit exceeded

@alltheseas has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Installer and CI changes: the Inno Setup script (scripts/windows-installer.iss) was parameterized for build architecture, switched to {autopf} for default install path, templated output/source variables, added architecture constraints and a post-install Run entry. The GitHub Actions workflow (.github/workflows/rust.yml) removed the dynamic ISS-generation step and now invokes ISCC with a single ISS and a BuildArch parameter.

Changes

Cohort / File(s) Summary
Windows Installer script
scripts/windows-installer.iss
Added BuildArch conditional block to select per-arch ExeSource and PkgOutputDir; replaced {pf}\Notedeck with {autopf}\Notedeck; made OutputDir dynamic ({#PkgOutputDir}); added ArchitecturesAllowed and ArchitecturesInstallIn64BitMode; changed files source to templated ExeSource; added Run entry to launch notedeck.exe after install.
CI: GitHub Actions workflow
.github/workflows/rust.yml
Removed the "Generate Inno Setup Script" step; updated Inno Setup invocation to call ISCC.exe once with /DBuildArch=${{ matrix.arch }} and the consolidated scripts\windows-installer.iss script.

Sequence Diagram(s)

sequenceDiagram
    participant CI as GitHub Actions Runner
    participant ISCC as Inno Setup Compiler (ISCC)
    participant Artifacts as Build Artifacts Store
    participant Installer as Generated Installer
    participant User as End User Installer

    CI->>Artifacts: build binaries (per-arch)
    CI->>ISCC: run ISCC /DBuildArch=matrix.arch with scripts/windows-installer.iss
    ISCC->>Artifacts: read `ExeSource` (arch-specific) and `{`#PkgOutputDir`}`
    ISCC-->>Installer: produce installer exe
    User->>Installer: run installer
    Installer->>User: install to `{autopf}\Notedeck` and set 64-bit mode
    Installer->>User: optionally run `notedeck.exe` (Run entry)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble lines of installer lore,
Archs aligned, no more 32-bit war.
{autopf} guides the rabbit's track,
One script now builds — hop, click, install, and back! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing the Windows installer to use the 64-bit Program Files directory instead of 32-bit.
Linked Issues check ✅ Passed The code changes directly address the architecture mismatch issue #1298 by using {autopf} for 64-bit Program Files and enforcing 64-bit installation with appropriate architecture directives.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Windows installer architecture issue; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alltheseas alltheseas force-pushed the fix/windows-installer-64bit branch from 9a2f9d6 to 9c89bb7 Compare February 20, 2026 14:36
@alltheseas alltheseas requested a review from jb55 February 20, 2026 14:36
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
scripts/windows-installer.iss (2)

1-11: Add a stable AppId to ensure correct upgrade/uninstall detection.

Without an explicit AppId, Inno Setup derives the install registry key from AppName. A future rename of the app (e.g., branding change) would break upgrade detection and leave orphaned entries in Add/Remove Programs.

♻️ Suggested addition
 [Setup]
 AppName=Damus Notedeck
+AppId={{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
 AppVersion=0.1

Generate a fresh GUID once (e.g., via PowerShell [Guid]::NewGuid()) and keep it constant across all future releases.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/windows-installer.iss` around lines 1 - 11, Add an explicit stable
AppId to the Inno Setup [Setup] section so upgrades/uninstalls are reliably
detected: generate a single GUID (e.g., via PowerShell [Guid]::NewGuid()), add
AppId={YOUR-GUID-HERE} to the setup entries in scripts/windows-installer.iss
(alongside AppName, AppVersion, etc.), and commit that GUID permanently so
future releases use the same AppId for correct upgrade/uninstall behavior.

3-3: AppVersion is hardcoded to 0.1 — consider driving it from the actual build version.

Every installer produced by this script will report version 0.1 in Add/Remove Programs, regardless of the actual notedeck release. Consider passing the version via the ISCC /D flag from the CI/CD step that invokes the compiler (e.g., iscc /DMyAppVersion=0.2.0 windows-installer.iss) and then referencing it here:

♻️ Suggested change
-AppVersion=0.1
+AppVersion={`#MyAppVersion`}

Then pass /DMyAppVersion=<version> from the build script.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/windows-installer.iss` at line 3, Replace the hardcoded AppVersion
value with a preprocessor symbol and use the ISCC /D flag to supply the real
build version: change the literal AppVersion=0.1 to reference the preprocessor
variable (AppVersion should use the {`#MyAppVersion`#} preprocessor symbol) and
update your CI build step to call iscc with /DMyAppVersion=<version> so the
installer picks up the actual release version at compile time.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/windows-installer.iss`:
- Around line 1-11: Add an explicit stable AppId to the Inno Setup [Setup]
section so upgrades/uninstalls are reliably detected: generate a single GUID
(e.g., via PowerShell [Guid]::NewGuid()), add AppId={YOUR-GUID-HERE} to the
setup entries in scripts/windows-installer.iss (alongside AppName, AppVersion,
etc.), and commit that GUID permanently so future releases use the same AppId
for correct upgrade/uninstall behavior.
- Line 3: Replace the hardcoded AppVersion value with a preprocessor symbol and
use the ISCC /D flag to supply the real build version: change the literal
AppVersion=0.1 to reference the preprocessor variable (AppVersion should use the
{`#MyAppVersion`#} preprocessor symbol) and update your CI build step to call iscc
with /DMyAppVersion=<version> so the installer picks up the actual release
version at compile time.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/rust.yml (1)

240-243: ⚠️ Potential issue | 🟠 Major

Move-Item with identical source and destination is dead code—remove it.

The ISS script is invoked with /DBuildArch=${{ matrix.arch }}, which causes the preprocessor to set PkgOutputDir to ..\packages\<arch> (see scripts/windows-installer.iss lines 7, 18). The installer is therefore already written to packages\<arch>\DamusNotedeckInstaller.exe. The step at lines 240-243 attempts to move the file from that path to itself, which silently succeeds on Windows and masks any actual errors (e.g., if the ISS failed to create the output). The New-Item is also unnecessary since ISS output creation to that directory is already part of the build.

♻️ Proposed fix: remove the dead step
-      # Move output
-      - name: Move Inno Script outputs to architecture-specific folder
-        run: |
-          New-Item -ItemType Directory -Force -Path packages\${{ matrix.arch }}
-          Move-Item -Path packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe -Destination packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/rust.yml around lines 240 - 243, Remove the entire
workflow step named "Move Inno Script outputs to architecture-specific folder"
(the block that runs New-Item and Move-Item) because Move-Item is a no-op here
and New-Item is unnecessary; delete that step so the workflow relies on the ISS
output already writing to packages\${{ matrix.arch }} (as configured via
/DBuildArch and PkgOutputDir) and avoid masking failures when the installer
isn't produced.
🧹 Nitpick comments (1)
.github/workflows/rust.yml (1)

211-212: Redundant "Build (Native Only)" step adds unnecessary CI time.

The cargo build --release here (no --target) outputs to target/release/ but the subsequent "Build" step at line 232 already builds with --target=${{ matrix.arch }}-pc-windows-msvc, which is the binary the ISS script consumes. For the x86_64 matrix this duplicates effort; for the aarch64 matrix it produces an x86_64 artifact that is never used.

♻️ Proposed fix: remove the redundant step
-      # Build
-      - name: Build (Native Only)
-        run: cargo build --release
-
       # Create packages directory
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/rust.yml around lines 211 - 212, Remove the redundant CI
step named "Build (Native Only)" that runs the command `cargo build --release`;
this duplicates work and produces unused artifacts for non-x86_64 matrix
entries—delete the step block so only the later "Build" step that uses
`--target=${{ matrix.arch }}-pc-windows-msvc` remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/rust.yml:
- Line 237: The ISS currently hardcodes ArchitecturesAllowed=x64compatible and
ArchitecturesInstallIn64BitMode=x64compatible; modify
scripts\windows-installer.iss to conditionally set those two directives to arm64
when the ISPP BuildArch symbol equals "aarch64" (otherwise keep x64compatible).
Use ISPP conditional logic around the ArchitecturesAllowed and
ArchitecturesInstallIn64BitMode lines, checking BuildArch and emitting "arm64"
for aarch64 builds and "x64compatible" for others so native ARM64 installers run
in native 64-bit mode.

---

Outside diff comments:
In @.github/workflows/rust.yml:
- Around line 240-243: Remove the entire workflow step named "Move Inno Script
outputs to architecture-specific folder" (the block that runs New-Item and
Move-Item) because Move-Item is a no-op here and New-Item is unnecessary; delete
that step so the workflow relies on the ISS output already writing to
packages\${{ matrix.arch }} (as configured via /DBuildArch and PkgOutputDir) and
avoid masking failures when the installer isn't produced.

---

Nitpick comments:
In @.github/workflows/rust.yml:
- Around line 211-212: Remove the redundant CI step named "Build (Native Only)"
that runs the command `cargo build --release`; this duplicates work and produces
unused artifacts for non-x86_64 matrix entries—delete the step block so only the
later "Build" step that uses `--target=${{ matrix.arch }}-pc-windows-msvc`
remains.

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 damus-io#1298

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alltheseas alltheseas force-pushed the fix/windows-installer-64bit branch from 9c89bb7 to cac9b75 Compare February 20, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows 11 install fails

1 participant