Skip to content

fix(installer): show version in title bar, set installer FileDescription (#637) - #640

Merged
y2hlbg merged 1 commit into
masterfrom
fix/installer-metadata
Apr 22, 2026
Merged

fix(installer): show version in title bar, set installer FileDescription (#637)#640
y2hlbg merged 1 commit into
masterfrom
fix/installer-metadata

Conversation

@caorushizi

Copy link
Copy Markdown
Member
  • installer/installer.nsh: customHeader macro sets Caption to "Setup - ${PRODUCT_NAME} ${VERSION}" so users can see which release they're installing from the window title (the default $(^SetupCaption) omits the version, and re-setting Name trips NSIS warning 6029 which electron-builder's -WX flag treats as a hard error).
  • scripts/build.ts: afterAllArtifactBuild hook runs the app-builder rcedit helper on the generated NSIS installer to rewrite its FileDescription to "${APP_NAME} installer". electron-builder's NsisTarget.computeVersionKey() hardcodes VIAddVersionKey /LANG=1033 "FileDescription" "${appInfo.description}", binding the installer's FileDescription to the app binary's (both drawn from package.json description); any in-NSIS override collides on the same LANG+key with a hard "already defined!" error that -WX does not gate. Post-processing with rcedit sidesteps this and lets installer and app binary carry distinct descriptions — same approach VS Code's Inno Setup pipeline uses (where "{AppName} Setup" is the default).

Closes #637

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…ion (#637)

- `installer/installer.nsh`: customHeader macro sets Caption to
  "Setup - ${PRODUCT_NAME} ${VERSION}" so users can see which release
  they're installing from the window title (the default $(^SetupCaption)
  omits the version, and re-setting Name trips NSIS warning 6029 which
  electron-builder's -WX flag treats as a hard error).
- `scripts/build.ts`: afterAllArtifactBuild hook runs the app-builder
  rcedit helper on the generated NSIS installer to rewrite its
  FileDescription to "${APP_NAME} installer". electron-builder's
  NsisTarget.computeVersionKey() hardcodes VIAddVersionKey /LANG=1033
  "FileDescription" "${appInfo.description}", binding the installer's
  FileDescription to the app binary's (both drawn from package.json
  description); any in-NSIS override collides on the same LANG+key
  with a hard "already defined!" error that -WX does not gate.
  Post-processing with rcedit sidesteps this and lets installer and
  app binary carry distinct descriptions — same approach VS Code's
  Inno Setup pipeline uses (where "{AppName} Setup" is the default).

Closes #637

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 22, 2026 15:26
@changeset-bot

changeset-bot Bot commented Apr 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dfcdf6a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the Windows NSIS installer metadata to improve user clarity and Windows file properties without triggering NSIS/electron-builder warning/error behaviors.

Changes:

  • Injects a custom NSIS customHeader macro to show the app version in the installer window title bar.
  • Post-processes the generated NSIS installer executable via app-builder rcedit in afterAllArtifactBuild to set a distinct FileDescription for the installer.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/electron/scripts/build.ts Adds afterAllArtifactBuild hook to rewrite the NSIS installer’s FileDescription via app-builder rcedit, and wires in the custom NSIS header include.
apps/electron/installer/installer.nsh Introduces customHeader macro to set the NSIS Caption to include ${PRODUCT_NAME} ${VERSION} (version shown in title bar).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfcdf6a6a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// such default, so we post-process the artifact with the same
// `app-builder rcedit` call electron-builder itself uses on
// `mediago.exe` (see winPackager.js around line 185).
afterAllArtifactBuild: async ({ artifactPaths }) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Rewrite installer metadata before publish tasks start

Using afterAllArtifactBuild to mutate the installer file is too late for this repo’s release path: .github/workflows/build-electron.yml runs pnpm release:electron with GH_TOKEN, and electron-builder schedules uploads/update-info work when each artifact is created, before afterAllArtifactBuild executes. That means the rcedit change can race with or follow upload/hash generation, leading to a published installer that still has the old FileDescription or a checksum mismatch in update metadata for auto-updates.

Useful? React with 👍 / 👎.

@y2hlbg
y2hlbg merged commit fc99be5 into master Apr 22, 2026
4 checks passed
@y2hlbg
y2hlbg deleted the fix/installer-metadata branch April 22, 2026 15:40
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.

Multilanguage installer - Improvements

3 participants