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(bundler): display name for bundle #9175

Closed

Conversation

mariotaku
Copy link
Contributor

@mariotaku mariotaku commented Mar 13, 2024

This PR Is for #8109, #8349 and #8363.

For Linux, productName needs to be converted to lower-kebab-case. To make sure app desktop entry displays user friendly name, displayName has been added.

Example:

{
  "productName": "myapp",
  "displayName": "My App"
}

@mariotaku mariotaku force-pushed the feature/per-platform-product-name branch from 6525d46 to d9d658d Compare March 13, 2024 13:07
@FabianLars
Copy link
Member

Hi, thanks for contributing! This is not a full review yet, as i don't have time today to actually try it out but for a start 2 remarks:

  1. This may have been added by accident but please remove the deb/rpm changes and open another PR for this if you want to see this in Tauri.
  2. in my opinion we shouldn't add this kind of platform specific configs but keep relying on https://tauri.app/v1/api/config#platform-specific-configuration
  3. Also, once this is not a draft anymore we'll need a changefile similar to those here: https://github.com/tauri-apps/tauri/tree/dev/.changes

@mariotaku
Copy link
Contributor Author

@FabianLars Hi! Thanks for the quick comment.

  1. I'll move deb/rpm changes to another PR.
  2. Sorry, I didn't notice we already have platform specific configuration already, I'll utilize it and add displayName only.
  3. Sure! I'll be making this change too.

@mariotaku mariotaku force-pushed the feature/per-platform-product-name branch from d9d658d to 6d86ff5 Compare March 13, 2024 14:08
@mariotaku mariotaku changed the title feat: platform-specific product name & display name feat: display name for bundle Mar 13, 2024
@mariotaku mariotaku marked this pull request as ready for review March 13, 2024 14:27
@mariotaku mariotaku requested a review from a team as a code owner March 13, 2024 14:27
@mariotaku
Copy link
Contributor Author

Done updating the change. Please let me know if there are anything missing :)

@mariotaku mariotaku force-pushed the feature/per-platform-product-name branch from bbbff88 to 23d9604 Compare March 14, 2024 02:11
@mariotaku mariotaku changed the title feat: display name for bundle feat(bundler): display name for bundle Mar 14, 2024
@mariotaku
Copy link
Contributor Author

Hi @FabianLars, is it possible to include this change in 2.0 release?

@mariotaku mariotaku force-pushed the feature/per-platform-product-name branch from 23d9604 to cf7dfc8 Compare March 27, 2024 08:00
@FabianLars
Copy link
Member

I hope so, yes. I didn't try it yet but your changes look correct and reasonable as far as i can see.

Paging @amrbashir for a double check on the windows installers

@xuchaoqian
Copy link
Contributor

Is it easy to confuse "product name" and "display name"?
How about using "bundle name" as the name for the bundle?

@mariotaku
Copy link
Contributor Author

@xuchaoqian Sounds good too, especially for Linux

@amrbashir
Copy link
Member

I am not keen on adding another option that is almost identical to productName.

#8109 can be fixed by keeping the executable name generated from cargo and avoid renaming it.

#8349 can be fixed by removing the implicit kebab-case conversion and ensure that productName is used as is in the generated .desktop file.

#8363 can be fixed by modifying the codepage and/or using a Chinese locale.

@FabianLars
Copy link
Member

sounds good to me too ig 🤷

@amrbashir
Copy link
Member

cc @lucasfernog

@lucasfernog
Copy link
Member

I like @amrbashir idea. But we need to at least make a copy of the binary to change its name, otherwise it'll look weird on linux and windows.

If we're going to break the bundler output paths, please do so asap.

@amrbashir
Copy link
Member

But we need to at least make a copy of the binary to change its name, otherwise it'll look weird on linux and windows

Could you explain a bit more, not sure if I understand the issue

@mariotaku
Copy link
Contributor Author

@amrbashir Thanks for your input, and I have some ideas about the solutions you've mentioned.

#8109 can be fixed by keeping the executable name generated from cargo and avoid renaming it.

This sound great, will you make bundler respect binary name defined in Cargo.toml? Or I could try making a PR.

#8349 can be fixed by removing the implicit kebab-case conversion and ensure that productName is used as is in the generated .desktop file.

I'm afraid this will have some issues, because debian package names are having lower-kebab-case. If you override productName in tauri.conf.json, title in desktop file generated will become lower-kebab-case too.

@amrbashir
Copy link
Member

This sound great, will you make bundler respect binary name defined in Cargo.toml? Or I could try making a PR.

Feel free to open a PR. The CLI renames the binary after it gets generated by Cargo, we just need to remove that behavior.

I'm afraid this will have some issues, because debian package names are having lower-kebab-case. If you override productName in tauri.conf.json, title in desktop file generated will become lower-kebab-case too.

Not sure I quite follow what you mean, but we only need to use kebab-case where required and keep everything else as the normal non-kebab-case productName.

@mariotaku
Copy link
Contributor Author

@amrbashir

I'm afraid this will have some issues, because debian package names are having lower-kebab-case. If you override productName in tauri.conf.json, title in desktop file generated will become lower-kebab-case too.

Not sure I quite follow what you mean, but we only need to use kebab-case where required and keep everything else as the normal non-kebab-case productName.

For bundles like deb, the name must be kebab-case. So this is where the conversion required. But this PR was trying to override the automatic conversion when it can't produce desired one.

For example, when the product name is webOS Dev Manager, it will be converted to web-os-dev-manager while the desired one would be webos-dev-manager, like OpenDeck in #8349.

Can this case be covered?

@amrbashir
Copy link
Member

I believe that could be covered by using a custom .desktop template.

@ninjadev64
Copy link

For example, when the product name is webOS Dev Manager, it will be converted to web-os-dev-manager while the desired one would be webos-dev-manager, like OpenDeck in #8349.

Exactly

@mariotaku
Copy link
Contributor Author

For example, when the product name is webOS Dev Manager, it will be converted to web-os-dev-manager while the desired one would be webos-dev-manager, like OpenDeck in #8349.

Exactly

I solved it by doing this:

  1. Create tauri.linux.conf.json and set productName to the one you want (for me, webos-dev-manager`) example
  2. Create a .desktop entry with the display name you want, and configure to make tauri use that. example

Not very straightforward but works fine

@ninjadev64
Copy link

ninjadev64 commented May 26, 2024

I solved it by doing this:

Oh, awesome! Do you know if that works on Tauri v1 as well (otherwise I can just https://tryitands.ee)?

Edit: it seems to work! I had to surround productName in package for it to work in Tauri v1.

@amrbashir
Copy link
Member

Just a note that we have decided to add mainBinaryName option in #10977 to control the main binary name, this makes productName essentially the displayName (which is what it was supposed to) and the new option for main binary name only.

@mariotaku mariotaku deleted the feature/per-platform-product-name branch September 16, 2024 03:35
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.

6 participants