Skip to content

Compile the Inno Setup scripts in CI so installer breakage is caught before release #17

Description

@trsdn

Problem

The Inno Setup scripts in installer/ are never compiled by cargo, so a change that breaks them passes every check in CI and only fails at release time.

This is not hypothetical. In PR #16 both installer/openwritr.iss and installer/openwritr-x64.iss stopped compiling:

Error on line 114 in installer/openwritr.iss: Column 65:
'BEGIN' expected.
Compile aborted.        (ISCC exit 2)

Cause: a new [Code] block used a Pascal { ... } comment whose text contained the Inno constant {userstartup}. Pascal block comments do not nest, so that } closed the comment early and the remaining prose was parsed as code. cargo fmt, cargo clippy and cargo test were all green throughout — the breakage was only caught by manually running ISCC.exe.

Proposal

Add a fast installer-syntax job to CI that compiles both scripts and fails the build on a non-zero ISCC exit code.

Implementation notes

  • Needs a Windows runner with Inno Setup 6. It is available via choco install innosetup or winget install JRSoftware.InnoSetup on windows-latest.
  • A full compile needs the payload the scripts reference, which we do not want to build just for a syntax check:
    • ..\target\stage\{arm64,x64} (created by scripts/prepare_release.py)
    • ..\LICENSE and installer\openwritr.ico
  • Cheapest reliable approach: stage a throwaway tree with the real LICENSE and .ico plus a dummy openwritr.exe in target/stage/<arch>/, then run ISCC.exe /Qp on each script and assert exit 0. This is exactly how the PR Add "Run at startup" toggle in Settings #16 breakage was reproduced and then confirmed fixed, and it takes seconds.
  • Write the output to a scratch directory, not target/dist, and do not upload the resulting setup executables as artifacts — they contain a dummy payload and must never be mistaken for a release build.
  • Run the job only when installer/** changes, to keep it off the hot path for ordinary code PRs.

Acceptance criteria

  • CI compiles both installer/openwritr.iss and installer/openwritr-x64.iss and fails on a non-zero ISCC exit code.
  • Reintroducing the PR Add "Run at startup" toggle in Settings #16 { ... } comment bug makes the job fail.
  • The job does not require a full release build and does not publish its output.
  • The job is skipped when no installer file changed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions