From ffe622a7259036326f2c9bd75cec19135c32821d Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 18 Jan 2026 16:25:16 +0800 Subject: [PATCH 1/6] feat(wix): add minimum webview2 version option --- crates/tauri-bundler/src/bundle/settings.rs | 9 +++++ .../src/bundle/windows/msi/main.wxs | 35 +++++++++++++++---- .../src/bundle/windows/msi/mod.rs | 4 +++ .../src/bundle/windows/nsis/mod.rs | 7 +++- crates/tauri-cli/config.schema.json | 10 ++++++ crates/tauri-cli/src/helpers/config.rs | 1 + crates/tauri-cli/src/interface/rust.rs | 1 + .../schemas/config.schema.json | 10 ++++++ crates/tauri-utils/src/config.rs | 10 ++++++ 9 files changed, 80 insertions(+), 7 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/settings.rs b/crates/tauri-bundler/src/bundle/settings.rs index 71321b2937ba..5638e4eae210 100644 --- a/crates/tauri-bundler/src/bundle/settings.rs +++ b/crates/tauri-bundler/src/bundle/settings.rs @@ -532,6 +532,10 @@ pub struct NsisSettings { /// Try to ensure that the WebView2 version is equal to or newer than this version, /// if the user's WebView2 is older than this version, /// the installer will try to trigger a WebView2 update. + #[deprecated( + since = "2.8.0", + note = "Use `WindowsSettings::minimum_webview2_version` instead." + )] pub minimum_webview2_version: Option, } @@ -587,6 +591,10 @@ pub struct WindowsSettings { /// if you are on another platform and want to cross-compile and sign you will /// need to use another tool like `osslsigncode`. pub sign_command: Option, + /// Try to ensure that the WebView2 version is equal to or newer than this version, + /// if the user's WebView2 is older than this version, + /// the installer will try to trigger a WebView2 update. + pub minimum_webview2_version: Option, } impl WindowsSettings { @@ -612,6 +620,7 @@ mod _default { webview_install_mode: Default::default(), allow_downgrades: true, sign_command: None, + minimum_webview2_version: None, } } } diff --git a/crates/tauri-bundler/src/bundle/windows/msi/main.wxs b/crates/tauri-bundler/src/bundle/windows/msi/main.wxs index a11b2ec4381c..4bc685860dba 100644 --- a/crates/tauri-bundler/src/bundle/windows/msi/main.wxs +++ b/crates/tauri-bundler/src/bundle/windows/msi/main.wxs @@ -279,16 +279,17 @@ {{#if install_webview}} - - - + + + + {{#if download_bootstrapper}} - + {{/if}} @@ -299,7 +300,7 @@ - + {{/if}} @@ -310,7 +311,29 @@ - + + + + {{/if}} + + + {{#if minimum_webview2_version}} + + + + + + + + + + + + {{/if}} diff --git a/crates/tauri-bundler/src/bundle/windows/msi/mod.rs b/crates/tauri-bundler/src/bundle/windows/msi/mod.rs index 4c00d8f333c0..a1b9aba95ef3 100644 --- a/crates/tauri-bundler/src/bundle/windows/msi/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/msi/mod.rs @@ -532,6 +532,10 @@ pub fn build_wix_app_installer( } } + if let Some(minimum_webview2_version) = &settings.windows().minimum_webview2_version { + data.insert("minimum_webview2_version", to_json(minimum_webview2_version)); + } + if let Some(license) = settings.license_file() { if license.ends_with(".rtf") { data.insert("license", to_json(license)); diff --git a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs index d4d8f2cac739..a67f59eda3fb 100644 --- a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs @@ -362,7 +362,12 @@ fn build_nsis_app_installer( if let Some(start_menu_folder) = &nsis.start_menu_folder { data.insert("start_menu_folder", to_json(start_menu_folder)); } - if let Some(minimum_webview2_version) = &nsis.minimum_webview2_version { + #[allow(deprecated)] + if let Some(minimum_webview2_version) = nsis + .minimum_webview2_version + .as_ref() + .or(settings.windows().minimum_webview2_version.as_ref()) + { data.insert( "minimum_webview2_version", to_json(minimum_webview2_version), diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 58fab551a462..81e309debda4 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -131,6 +131,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "minimumWebview2Version": null, "nsis": null, "signCommand": null, "timestampUrl": null, @@ -2204,6 +2205,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "minimumWebview2Version": null, "nsis": null, "signCommand": null, "timestampUrl": null, @@ -2646,6 +2648,13 @@ "default": true, "type": "boolean" }, + "minimumWebview2Version": { + "description": "Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", + "type": [ + "string", + "null" + ] + }, "wix": { "description": "Configuration for the MSI generated with WiX.", "anyOf": [ @@ -3025,6 +3034,7 @@ }, "minimumWebview2Version": { "description": "Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", + "deprecated": true, "type": [ "string", "null" diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index d819867bdbe3..929f1fe577d2 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -118,6 +118,7 @@ pub fn nsis_settings(config: NsisConfig) -> tauri_bundler::NsisSettings { compression: config.compression, start_menu_folder: config.start_menu_folder, installer_hooks: config.installer_hooks, + #[allow(deprecated)] minimum_webview2_version: config.minimum_webview2_version, } } diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index a9a42363ab71..3c5f93efad09 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -1613,6 +1613,7 @@ fn tauri_config_to_bundle_settings( webview_install_mode: config.windows.webview_install_mode, allow_downgrades: config.windows.allow_downgrades, sign_command: config.windows.sign_command.map(custom_sign_settings), + minimum_webview2_version: config.windows.minimum_webview2_version, }, license: config.license.or_else(|| { settings diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 58fab551a462..81e309debda4 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -131,6 +131,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "minimumWebview2Version": null, "nsis": null, "signCommand": null, "timestampUrl": null, @@ -2204,6 +2205,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "minimumWebview2Version": null, "nsis": null, "signCommand": null, "timestampUrl": null, @@ -2646,6 +2648,13 @@ "default": true, "type": "boolean" }, + "minimumWebview2Version": { + "description": "Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", + "type": [ + "string", + "null" + ] + }, "wix": { "description": "Configuration for the MSI generated with WiX.", "anyOf": [ @@ -3025,6 +3034,7 @@ }, "minimumWebview2Version": { "description": "Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", + "deprecated": true, "type": [ "string", "null" diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 4350398d011f..698839958d22 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -929,6 +929,10 @@ pub struct NsisConfig { /// Try to ensure that the WebView2 version is equal to or newer than this version, /// if the user's WebView2 is older than this version, /// the installer will try to trigger a WebView2 update. + #[deprecated( + since = "2.10.0", + note = "Use `WindowsConfig::minimum_webview2_version` instead." + )] #[serde(alias = "minimum-webview2-version")] pub minimum_webview2_version: Option, } @@ -1043,6 +1047,11 @@ pub struct WindowsConfig { /// The default value of this flag is `true`. #[serde(default = "default_true", alias = "allow-downgrades")] pub allow_downgrades: bool, + /// Try to ensure that the WebView2 version is equal to or newer than this version, + /// if the user's WebView2 is older than this version, + /// the installer will try to trigger a WebView2 update. + #[serde(alias = "minimum-webview2-version")] + pub minimum_webview2_version: Option, /// Configuration for the MSI generated with WiX. pub wix: Option, /// Configuration for the installer generated with NSIS. @@ -1067,6 +1076,7 @@ impl Default for WindowsConfig { tsp: false, webview_install_mode: Default::default(), allow_downgrades: true, + minimum_webview2_version: None, wix: None, nsis: None, sign_command: None, From 66e54b1be99291ad6e4bb0e1ae552f433b6dec1b Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 18 Jan 2026 16:27:03 +0800 Subject: [PATCH 2/6] Add change file --- .changes/wix-minimum-webview2-version.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changes/wix-minimum-webview2-version.md diff --git a/.changes/wix-minimum-webview2-version.md b/.changes/wix-minimum-webview2-version.md new file mode 100644 index 000000000000..055604bce6e5 --- /dev/null +++ b/.changes/wix-minimum-webview2-version.md @@ -0,0 +1,7 @@ +--- +"tauri-bundler": minor:feat +"tauri-cli": minor:feat +"@tauri-apps/cli": minor:feat +--- + +Added support for `minimumWebview2Version` option support for the MSI (Wix) installer, the old `bundle > windows > nsis > minimumWebview2Version` is now deprecated in favor of `bundle > windows > minimumWebview2Version` From 87fa0c3d3fb94523a321f42e9ebad9eb570883eb Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 18 Jan 2026 16:32:12 +0800 Subject: [PATCH 3/6] Format --- crates/tauri-bundler/src/bundle/windows/msi/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/tauri-bundler/src/bundle/windows/msi/mod.rs b/crates/tauri-bundler/src/bundle/windows/msi/mod.rs index a1b9aba95ef3..ad0533601686 100644 --- a/crates/tauri-bundler/src/bundle/windows/msi/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/msi/mod.rs @@ -533,7 +533,10 @@ pub fn build_wix_app_installer( } if let Some(minimum_webview2_version) = &settings.windows().minimum_webview2_version { - data.insert("minimum_webview2_version", to_json(minimum_webview2_version)); + data.insert( + "minimum_webview2_version", + to_json(minimum_webview2_version), + ); } if let Some(license) = settings.license_file() { From 0bc6e98c667d8422a1350635c81fc7da59983414 Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 18 Jan 2026 16:33:38 +0800 Subject: [PATCH 4/6] Move comments inside `#if` block --- crates/tauri-bundler/src/bundle/windows/msi/main.wxs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/windows/msi/main.wxs b/crates/tauri-bundler/src/bundle/windows/msi/main.wxs index 4bc685860dba..2ce3a74145aa 100644 --- a/crates/tauri-bundler/src/bundle/windows/msi/main.wxs +++ b/crates/tauri-bundler/src/bundle/windows/msi/main.wxs @@ -286,6 +286,7 @@ {{#if download_bootstrapper}} + @@ -294,8 +295,8 @@ {{/if}} - {{#if webview2_bootstrapper_path}} + @@ -305,8 +306,8 @@ {{/if}} - {{#if webview2_installer_path}} + @@ -316,8 +317,8 @@ {{/if}} - {{#if minimum_webview2_version}} + From 857300b59d2e471df4eb5600b843315f2d62b059 Mon Sep 17 00:00:00 2001 From: Tony Date: Sun, 18 Jan 2026 21:24:29 +0800 Subject: [PATCH 5/6] add breaking change notes --- .changes/wix-minimum-webview2-version.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.changes/wix-minimum-webview2-version.md b/.changes/wix-minimum-webview2-version.md index 055604bce6e5..2b34203f6467 100644 --- a/.changes/wix-minimum-webview2-version.md +++ b/.changes/wix-minimum-webview2-version.md @@ -5,3 +5,8 @@ --- Added support for `minimumWebview2Version` option support for the MSI (Wix) installer, the old `bundle > windows > nsis > minimumWebview2Version` is now deprecated in favor of `bundle > windows > minimumWebview2Version` + +Notes: + +- For anyone relying on the `WVRTINSTALLED` `Property` tag in `main.wxs`, it is now renamed to `INSTALLED_WEBVIEW2_VERSION` +- For `tauri-bundler` lib users, the `WindowsSettings` now has a new field `minimum_webview2_version` which can be a breaking change From 49225bf9eb0f2a8f056123ae039127a82b7fb946 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 30 Jan 2026 10:25:45 +0800 Subject: [PATCH 6/6] Add deprecation to description schema --- crates/tauri-cli/config.schema.json | 2 +- crates/tauri-schema-generator/schemas/config.schema.json | 2 +- crates/tauri-utils/src/config.rs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 81e309debda4..7d9995140b2e 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -3033,7 +3033,7 @@ ] }, "minimumWebview2Version": { - "description": "Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", + "description": "Deprecated: use [`WindowsConfig::minimum_webview2_version`] (`bundle > windows > minimumWebview2Version`) instead.\n\n Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", "deprecated": true, "type": [ "string", diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 81e309debda4..7d9995140b2e 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -3033,7 +3033,7 @@ ] }, "minimumWebview2Version": { - "description": "Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", + "description": "Deprecated: use [`WindowsConfig::minimum_webview2_version`] (`bundle > windows > minimumWebview2Version`) instead.\n\n Try to ensure that the WebView2 version is equal to or newer than this version,\n if the user's WebView2 is older than this version,\n the installer will try to trigger a WebView2 update.", "deprecated": true, "type": [ "string", diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 698839958d22..56bfd277fd99 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -926,6 +926,8 @@ pub struct NsisConfig { /// ``` #[serde(alias = "installer-hooks")] pub installer_hooks: Option, + /// Deprecated: use [`WindowsConfig::minimum_webview2_version`] (`bundle > windows > minimumWebview2Version`) instead. + /// /// Try to ensure that the WebView2 version is equal to or newer than this version, /// if the user's WebView2 is older than this version, /// the installer will try to trigger a WebView2 update.