fix(installer): show version in title bar, set installer FileDescription (#637) - #640
Conversation
…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>
|
There was a problem hiding this comment.
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
customHeadermacro to show the app version in the installer window title bar. - Post-processes the generated NSIS installer executable via
app-builder rceditinafterAllArtifactBuildto set a distinctFileDescriptionfor 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). |
There was a problem hiding this comment.
💡 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 }) => { |
There was a problem hiding this comment.
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 👍 / 👎.
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