-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix (windows) removed NSIS semver build version numeric only validation #12136
base: dev
Are you sure you want to change the base?
Conversation
Package Changes Through 861c350There are 3 changes which include tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
your first change file was correct. the bot sends the link to create a new one unconditionally at the moment :/ |
@FabianLars haha, it got me. Gonna remove the bot generated file then. Thanks 🙇 |
Okay so i just checked again and this won't work. I'm not sure what We could modify the check to replace the build/pre data with |
I have additionally researched this topic a bit more and it looks like @FabianLars is correct - NSIS VIProductVersion requires all 4 parts to be numbers. One thing I noticed, that msi convert_version method has additional validation regarding correctness of each version part. Which might be added to nsis in order to unify this behavior. |
Yeah, fair. I'm just thinking about how to expose VIAddVersionKey to devs, which supports non-numeric versions, without adding yet another version config. |
If we would decide to expose build version with non-numeric values as a VIAddVersionKey to devs - it would require interpreting VIProductVersion in some way. Either to add .0 at the end (which would replicate default NSIS behavior) or to add stripped out version of non-numeric build version (remove non-numeric values from the build version). In both cases this would introduce unexpected behavior |
Although after checking initial Bug it looks like author of that ticket was expecting that file version would have default .0 revision value instead of non-numeric build version value (probably expecting same behavior for VIProductVersion). In that case it looks like for non-numeric build numbers we could set VIProductVersion and FileVersion with values where non-numeric build version would be replaced by .0 and for product version it would return original build version |
@FabianLars please verify if my assumptions are correct and this PR can be merged. 🙇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both cases this would introduce unexpected behavior
The question would be where? Where is VIProductVersion used that this would cause issues. The only thing i can think of that we have to check is updating == installing 1.0.0-builld.20 when 1.0.0-beta.1 is already installed on the system.
Tauri's update can handle that fine but the installers, or at least the wix installer have built-in checks for this as well, not sure how our nsis installer behaves.
VIAddVersionKey "FileVersion" "${VERSION}" | ||
VIAddVersionKey "ProductVersion" "${VERSION}" | ||
VIAddVersionKey "ProductVersion" "${VERSIONWITHBUILD}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be reverted.
- FileVersion and ProductVersion should show the same value and both should support semver.
- Talking about the VIAddVersionKey variant, not
VIProductVersion
/VIFileVersion
!
- Talking about the VIAddVersionKey variant, not
- We use
VERSION
a few more times in this file where it expects the full semver.
VIProductVersion should be the only thing that gets a modified version.
So i think the approach in general (for the other files as well) would be:
- Set VERSION with the user specified version without modifications
- Try to use the user specified version for VERSIONWITHBUILD, print a warning if the prerelease/build data is non-numeric and replace it with
.0
Example:
- User sets
1.0.0+123
- VERSION ==
1.0.0+123
- VERSIONWITHBUILD ==
1.0.0.123
- VERSION ==
- User sets
1.0.0+build123
- VERSION ==
1.0.0+build123
- VERSIONWITHBUILD ==
1.0.0.0
but with a warning log
- VERSION ==
One thing that i'm unsure about is the prerelease data so 1.0.0-beta
instead of 1.0.0+beta
. This is currently ignored in the versionwithbuild logic. I guess that's fine though and good in context of my other comment because it means that updating should already work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted changes, added warning log. Now it should work as you have described it
Closes #8038