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

feat: Add support for using Product Name #10938

Closed
wants to merge 6 commits into from

Conversation

Geometrically
Copy link

@Geometrically Geometrically commented Sep 10, 2024

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 using v2.x.

Approach:

I'm introducing here an option for the tauri-cli (tauri-bundler) for producing the same binary names it did in v1, allowing users to update the app via the updater. In order to enable this behavior, set the environment variable

V1_COMPATIBLE_BIN_NAME=true

Previously, 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

@amrbashir
Copy link
Member

I am looking into all issues related to v1 -> v2 updater so bear with me until I get this all sorted out.

@Geometrically Geometrically marked this pull request as ready for review September 10, 2024 04:56
@Geometrically
Copy link
Author

No worries- I fully tested this on Windows/MacOS/Linux and everything seems to be working as expected :)

@lucasfernog
Copy link
Member

I believe we can close this one now that we have #10939 #10996 #10977 #10969 #10967 #10962 #10952

@amrbashir
Copy link
Member

amrbashir commented Sep 15, 2024

yeah, that correct, this is not longer needed and if productName needs to be used, you can set the new mainBinaryName option to the same value as productName.

Apologies for the inconvenience.

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.

[feat] tauri migrate shoud migrate main bin name to product name
3 participants