-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
18.2.0 and above don't support non-numeric fourth version component #1714
Comments
👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Some added context - I think the new version parsing code may just need some additional handling for the portion of the version after the |
Hey @MariaSemple @gtritchie, looking into this issue it does seem like this is a regression in behaviour, but I think the previous functioning behaviour was unintended. On Windows, Packager modifies the VERSIONINFO
The In v18.1.3 and prior, this resource metadata used to be set via the rcedit executable: Lines 45 to 47 in a810162
Under the hood, the previous implementation of this code looked like: bool parse_version_string(const wchar_t* str, unsigned short *v1, unsigned short *v2, unsigned short *v3, unsigned short *v4) {
*v1 = *v2 = *v3 = *v4 = 0;
return (swscanf_s(str, L"%hu.%hu.%hu.%hu", v1, v2, v3, v4) == 4) ||
(swscanf_s(str, L"%hu.%hu.%hu", v1, v2, v3) == 3) ||
(swscanf_s(str, L"%hu.%hu", v1, v2) == 2) ||
(swscanf_s(str, L"%hu", v1) == 1);
} Reading the code, I think the intent was always to only accept between 1 and 4 period-separated short integers. I think the original v18.2.0 refactored the implementation to drop Lines 21 to 33 in d9655d4
However, the I think the path forward for apps should be to set the |
Thanks, I can look at tweaking the version info just on our Windows builds to conform to numeric x.x.x.x. Builds produced with the earlier packager were falling back to Some recent builds produced with the earlier packager: 2024.04.0+735.pro32024.07.0-daily+89.pro1 |
Preflight Checklist
Issue Details
Expected Behavior
Prior to 18.2.0, a version string (i.e. in package.json "version") of the form "2024.07.0-hourly+56.pro14" was accepted by electron-packager during the packaging process on Windows. We've been using this format for several years. It continues working for Mac and Linux.
Actual Behavior
Starting with 18.2.0 (presumably due to this PR) an error occurs during packaging:
Incorrectly formatted version string: "2024.07.0-hourly+56.pro14". Component "pro14" could not be parsed as an integer
To Reproduce
package.json
contains the troublesome version string, and pins electron-packager to 18.3.2Gives the error
Incorrectly formatted version string: "2024.07.0-hourly+56.pro14". Component "pro14" could not be parsed as an integer
.Edit package.json and change @electron/packager version to 18.1.3 and:
Succeeds.
Additional Information
NA
The text was updated successfully, but these errors were encountered: