Skip to content

Commit a1e88d2

Browse files
enhance(bundler/wix): generate consistent product code for MSI installer 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>
1 parent fe5ff12 commit a1e88d2

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-bundler": "patch:enhance"
3+
---
4+
5+
Generate a consistent Product code for MSI installer derived from `identifier` instead of generating random one each build.
6+

crates/tauri-bundler/src/bundle/windows/msi/wix.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,12 @@ pub fn build_wix_app_installer(
529529
.to_string();
530530

531531
data.insert("upgrade_code", to_json(upgrade_code.as_str()));
532+
let product_code = Uuid::new_v5(
533+
&Uuid::NAMESPACE_DNS,
534+
&settings.bundle_identifier().as_bytes(),
535+
)
536+
.to_string();
537+
data.insert("product_code", to_json(product_code.as_str()));
532538
data.insert(
533539
"allow_downgrades",
534540
to_json(settings.windows().allow_downgrades),

crates/tauri-bundler/src/bundle/windows/templates/main.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
1515
<Product
16-
Id="*"
16+
Id="{{product_code}}"
1717
Name="{{product_name}}"
1818
UpgradeCode="{{upgrade_code}}"
1919
Language="!(loc.TauriLanguage)"

0 commit comments

Comments
 (0)