瀏覽代碼

fix(bundler): set app name when signing MSI, closes #3945 (#3950)

Lucas Fernandes Nogueira 3 年之前
父節點
當前提交
8e1daad153

+ 5 - 0
.changes/fix-windows-sign-product-name.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": patch
+---
+
+Set the application name when signing the Windows MSI.

+ 1 - 0
tooling/bundler/src/bundle/windows/msi/wix.rs

@@ -379,6 +379,7 @@ pub fn build_wix_app_installer(
       sign(
         &file_path,
         &SignParams {
+          product_name: settings.product_name().into(),
           digest_algorithm: settings
             .windows()
             .digest_algorithm

+ 2 - 0
tooling/bundler/src/bundle/windows/sign.rs

@@ -15,6 +15,7 @@ use winreg::{
 };
 
 pub struct SignParams {
+  pub product_name: String,
   pub digest_algorithm: String,
   pub certificate_thumbprint: String,
   pub timestamp_url: Option<String>,
@@ -103,6 +104,7 @@ pub fn sign<P: AsRef<Path>>(path: P, params: &SignParams) -> crate::Result<()> {
   cmd.arg("sign");
   cmd.args(&["/fd", &params.digest_algorithm]);
   cmd.args(&["/sha1", &params.certificate_thumbprint]);
+  cmd.args(&["/d", &params.product_name]);
 
   if let Some(ref timestamp_url) = params.timestamp_url {
     if params.tsp == Some(true) {