Skip to content

fix(maker-squirrel): normalize semver versions for Squirrel.Windows - #4367

Open
lvyanyan wants to merge 1 commit into
electron:mainfrom
lvyanyan:fix-squirrel-prerelease-version
Open

fix(maker-squirrel): normalize semver versions for Squirrel.Windows#4367
lvyanyan wants to merge 1 commit into
electron:mainfrom
lvyanyan:fix-squirrel-prerelease-version

Conversation

@lvyanyan

@lvyanyan lvyanyan commented Sep 3, 2026

Copy link
Copy Markdown

Description of Change

Squirrel.Windows (NuGet) only accepts 4-part version numbers, so a semver prerelease in package.json (e.g. 1.0.1-0 from npm version prerelease) made createWindowsInstaller fail with "'1.0.1-0' is not a valid version string".

The base maker already ships normalizeWindowsVersion() for exactly this — used by the AppX maker — but the Squirrel maker never picked it up (noted by @erickzhao in #3533). This routes the version passed to electron-winstaller through it, and names the nupkg artifacts from the normalized version.

Tests: added packages/maker/squirrel/spec/MakerSquirrel.spec.ts covering the prerelease case (1.0.1-01.0.1.0) and the plain case (1.2.31.2.3.0); red without the fix, green with it.

Drafted with AI assistance and reviewed by the author.

Issues

Fixes #3533

Checklist

Release Notes

Notes: Fixed creating Windows Squirrel installers for apps using semver prerelease versions such as 1.0.1-0.

Squirrel.Windows (NuGet) only accepts 4-part version numbers, so a
semver prerelease in package.json (e.g. 1.0.1-0 from npm version
prerelease) made createWindowsInstaller fail with "'1.0.1-0' is not a
valid version string".

The base maker already ships normalizeWindowsVersion() for exactly this
(used by the AppX maker); route the version passed to electron-winstaller
through it and name the nupkg artifacts from the normalized version.

Fixes electron#3533

Signed-off-by: lvyanyan <lvyanyan@users.noreply.github.com>
@lvyanyan
lvyanyan requested a review from a team as a code owner September 3, 2026 13:34
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.

Hyphens ('1.0.1-0') not a valid version string when building on @electron-forge/maker-squirrel

1 participant