feat: Add support for using Product Name #10938
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is based off the work here gitbutlerapp#1 by @Krivi. (most of this PR description was taken from there- it was very well written!)
Background:
This change in Tauri https://github.com/tauri-apps/tauri/pull/9375/files, which is noted as a refactor is in fact a breaking change as far as the app updater is concerned.
The impact is that because the binary now has a different name, it is not possible to smoothly update a Tauri application via the updater if the initial version of the app is using
v1.x
and the new version is usingv2.x
.Approach:
I'm introducing here an option for the
tauri-cli
(tauri-bundler
) for producing the same binary names it did inv1
, allowing users to update the app via the updater. In order to enable this behavior, set the environment variablePreviously, the bundler did the rename just after building the binary. I poked and tried doing the same once again, but because quite a lot of the code in that bundler changed since that was merged, it felt possibly more error prone (since now the rest of the code can safely assume that the binary is the crate name)
So, instead, my approach is to do the rename the binary at the last moment (i.e. in the
bundle_project
function in eg. app.rs)fixes #10548
Testing
This PR has been tested across Windows, MacOS, and Linux with the Modrinth App. You can find test builds built using this PR here: https://github.com/modrinth/code/actions/runs/10785759488