-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Describe the bug
When bundling an application using the default name (tauri-app) and installing it using the generated .msi, winget list or winget list --upgrade-available (if product_version < 1.0.3) will reference an unrelated application: maqibin.MDXNotes.
This could ultimately lead to unwanted installations using winget upgrade --all.
Related issue on winget-cli repo: microsoft/winget-cli#6040 by @tkappedev
Related code:
tauri/crates/tauri-bundler/src/bundle/windows/msi/mod.rs
Lines 582 to 592 in 88c0568
| let upgrade_code = settings | |
| .windows() | |
| .wix | |
| .as_ref() | |
| .and_then(|w| w.upgrade_code) | |
| .unwrap_or_else(|| { | |
| Uuid::new_v5( | |
| &Uuid::NAMESPACE_DNS, | |
| format!("{}.exe.app.x64", &settings.product_name()).as_bytes(), | |
| ) | |
| }); |
If above code is modified, the cli would need adjustments too:
tauri/crates/tauri-cli/src/inspect.rs
Lines 38 to 43 in 88c0568
| let product_name = interface.app_settings().get_package_settings().product_name; | |
| let upgrade_code = uuid::Uuid::new_v5( | |
| &uuid::Uuid::NAMESPACE_DNS, | |
| format!("{product_name}.exe.app.x64").as_bytes(), | |
| ); |
Reproduction
- Choose any preferred variant of create-tauri-app: https://v2.tauri.app/start/create-project/
- When prompted on name, etc., select the default settings, keep name as 'tauri-app' and choose any stack
- Build the application: https://v2.tauri.app/reference/cli/#build
- Install the application with the created .msi package (tauri-app\src-tauri\target\release\bundle\msi\tauri-app_0.1.0_x64_en-US.msi) and use default install location (C:\Program Files\tauri-app)
- Do a
winget listorwinget list --upgrade-available.- The installed app will be detected as
maqibin.MDXNotes, and with winget as source
Expected behavior
Using an additional and suitable property of the package to generate a truly unique upgrade_code per application.
Full tauri info output
-
Stack trace
Additional context
No response