Skip to content

Commit

Permalink
enhance(bundler/wix): generate consistent product code for MSI instal…
Browse files Browse the repository at this point in the history
…ler derived from identifier (#10969)

* enhance(bundler/wix): generate consistent product code for MSI installer derived from identifier

* Update .changes/wix-consistent-product-code.md [skip ci]

* Update .changes/wix-consistent-product-code.md [skip ci]

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
  • Loading branch information
amrbashir and lucasfernog authored Sep 13, 2024
1 parent fe5ff12 commit a1e88d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/wix-consistent-product-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-bundler": "patch:enhance"
---

Generate a consistent Product code for MSI installer derived from `identifier` instead of generating random one each build.

6 changes: 6 additions & 0 deletions crates/tauri-bundler/src/bundle/windows/msi/wix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ pub fn build_wix_app_installer(
.to_string();

data.insert("upgrade_code", to_json(upgrade_code.as_str()));
let product_code = Uuid::new_v5(
&Uuid::NAMESPACE_DNS,
&settings.bundle_identifier().as_bytes(),
)
.to_string();
data.insert("product_code", to_json(product_code.as_str()));
data.insert(
"allow_downgrades",
to_json(settings.windows().allow_downgrades),
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-bundler/src/bundle/windows/templates/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Id="*"
Id="{{product_code}}"
Name="{{product_name}}"
UpgradeCode="{{upgrade_code}}"
Language="!(loc.TauriLanguage)"
Expand Down

0 comments on commit a1e88d2

Please sign in to comment.