Skip to content

[bug] Generated upgrade_code for default product_name (tauri-app) causes ambiguity with an unrelated winget application #14968

@drebouta

Description

@drebouta

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:

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:

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

microsoft/winget-cli#6040

  1. Choose any preferred variant of create-tauri-app: https://v2.tauri.app/start/create-project/
  2. When prompted on name, etc., select the default settings, keep name as 'tauri-app' and choose any stack
  3. Build the application: https://v2.tauri.app/reference/cli/#build
  4. 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)
  5. Do a winget list or winget list --upgrade-available.
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions