diff --git a/.changes/wix-consistent-product-code.md b/.changes/wix-consistent-product-code.md new file mode 100644 index 00000000000..3fc39cf377d --- /dev/null +++ b/.changes/wix-consistent-product-code.md @@ -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. + diff --git a/crates/tauri-bundler/src/bundle/windows/msi/wix.rs b/crates/tauri-bundler/src/bundle/windows/msi/wix.rs index 362ca1ff87f..54b19bac20d 100644 --- a/crates/tauri-bundler/src/bundle/windows/msi/wix.rs +++ b/crates/tauri-bundler/src/bundle/windows/msi/wix.rs @@ -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), diff --git a/crates/tauri-bundler/src/bundle/windows/templates/main.wxs b/crates/tauri-bundler/src/bundle/windows/templates/main.wxs index 047b0926e1a..c6941a94b82 100644 --- a/crates/tauri-bundler/src/bundle/windows/templates/main.wxs +++ b/crates/tauri-bundler/src/bundle/windows/templates/main.wxs @@ -13,7 +13,7 @@