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>
This commit is contained in:
Amr Bashir 2024-09-13 14:45:03 +03:00 committed by GitHub
parent fe5ff1228c
commit a1e88d2b57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -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.

View File

@ -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),

View File

@ -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)"