Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid major number number in: <version> #7789

Closed
james-pre opened this issue Sep 20, 2023 · 4 comments
Closed

Error: Invalid major number number in: <version> #7789

james-pre opened this issue Sep 20, 2023 · 4 comments
Labels

Comments

@james-pre
Copy link

  • Electron-Builder Version: 24.6.4, 24.6.5
  • Node Version: 18.17.1
  • Electron Version: 26.2.1
  • Electron Type (current, beta, nightly): current
  • Target: Windows
Error: Invalid major number in: alpha-1.4.4
    at AppInfo.getVersionInWeirdWindowsForm (<project-root>\node_modules\app-builder-lib\src\appInfo.ts:83:13)
    at WinPackager.signAndEditResources (<project-root>\node_modules\app-builder-lib\src\winPackager.ts:294:46)
    at <project-root>\node_modules\app-builder-lib\src\winPackager.ts:386:21
@james-pre
Copy link
Author

Research:

The error is thrown by appInfo.getVersionInWeirdWindowsForm() in WinPackager.ts:

appInfo.shortVersionWindows || appInfo.getVersionInWeirdWindowsForm(),

Since it won't be called if appInfo.shortVersionWindows is set, it would be beneficial if that could be set by the user. In the AppInfo constructor, shortVersionWindows is set like so:

if (info.metadata.shortVersionWindows) {
	this.shortVersionWindows = info.metadata.shortVersionWindows
}

This means the user needs to be able to set the metadata.shortVersionWindows of the Packager instance passed to the AppInfo constructor (as info).

The AppInfo instance is created by Packager in its _build method:

this._appInfo = new AppInfo(this, null)

Packager assigns to its metadata like so:

deepAssign(this.metadata, configuration.extraMetadata)

So it should be possible to pass shortVersionWindows to extraMetadata.

@james-pre
Copy link
Author

The build fails with this command:

<user>\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe' '\dist\win-unpacked\<app name>-client.exe' --set-version-string FileDescription '<app name> Client' --set-version-string ProductName '<app name> Client' --set-version-string LegalCopyright '<copyright>' --set-file-version <version> --set-product-version <version> --set-version-string InternalName <app name>-client --set-version-string OriginalFilename '' --set-version-string CompanyName 'Dr. Vortex' --set-icon '<project>\dist\.icon-ico\icon.ico

and the error:
Fatal error: Unable to parse version string for FileVersion

Looking at the output, the error is caused by these 2 flags:

--set-file-version <version>
--set-product-version <version>

Which I presume is because <version> looks like string-1.2.3. Is it possible to use a version like that?

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 25, 2023
Copy link
Contributor

This issue was closed because it has been stalled for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant