Skip to content

Commit 073bb4f

Browse files
authored
refactor(core): remove deprecated webview_fixed_runtime_path option (#10772)
* refactor(core): remove deprecated webview_fixed_runtime_path option * update migration
1 parent 792340a commit 073bb4f

File tree

11 files changed

+79
-83
lines changed

11 files changed

+79
-83
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"tauri-utils": patch:breaking
3+
"@tauri-apps/cli": patch:breaking
4+
"tauri-cli": patch:breaking
5+
"tauri-bundler": patch:breaking
6+
---
7+
8+
Removed the deprecated `webview_fixed_runtime_path` config option, use the `webview_install_mode` instead.

core/tauri-build/src/lib.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,10 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
576576
.clone()
577577
.unwrap_or_else(|| BundleResources::List(Vec::new()));
578578
if target_triple.contains("windows") {
579-
if let Some(fixed_webview2_runtime_path) =
580-
match &config.bundle.windows.webview_fixed_runtime_path {
581-
Some(path) => Some(path),
582-
None => match &config.bundle.windows.webview_install_mode {
583-
WebviewInstallMode::FixedRuntime { path } => Some(path),
584-
_ => None,
585-
},
586-
}
587-
{
579+
if let Some(fixed_webview2_runtime_path) = match &config.bundle.windows.webview_install_mode {
580+
WebviewInstallMode::FixedRuntime { path } => Some(path),
581+
_ => None,
582+
} {
588583
resources.push(fixed_webview2_runtime_path.display().to_string());
589584
}
590585
}

core/tauri-config-schema/schema.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
"signCommand": null,
121121
"timestampUrl": null,
122122
"tsp": false,
123-
"webviewFixedRuntimePath": null,
124123
"webviewInstallMode": {
125124
"silent": true,
126125
"type": "downloadBootstrapper"
@@ -1650,7 +1649,6 @@
16501649
"signCommand": null,
16511650
"timestampUrl": null,
16521651
"tsp": false,
1653-
"webviewFixedRuntimePath": null,
16541652
"webviewInstallMode": {
16551653
"silent": true,
16561654
"type": "downloadBootstrapper"
@@ -1998,13 +1996,6 @@
19981996
}
19991997
]
20001998
},
2001-
"webviewFixedRuntimePath": {
2002-
"description": "Path to the webview fixed runtime to use. Overwrites [`Self::webview_install_mode`] if set.\n\n Will be removed in v2, prefer the [`Self::webview_install_mode`] option.\n\n The fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section).\n The `.cab` file must be extracted to a folder and this folder path must be defined on this field.",
2003-
"type": [
2004-
"string",
2005-
"null"
2006-
]
2007-
},
20081999
"allowDowngrades": {
20092000
"description": "Validates a second app installation, blocking the user from installing an older version if set to `false`.\n\n For instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`.\n\n The default value of this flag is `true`.",
20102001
"default": true,

core/tauri-utils/src/config.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -948,14 +948,6 @@ pub struct WindowsConfig {
948948
/// The installation mode for the Webview2 runtime.
949949
#[serde(default, alias = "webview-install-mode")]
950950
pub webview_install_mode: WebviewInstallMode,
951-
/// Path to the webview fixed runtime to use. Overwrites [`Self::webview_install_mode`] if set.
952-
///
953-
/// Will be removed in v2, prefer the [`Self::webview_install_mode`] option.
954-
///
955-
/// The fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section).
956-
/// The `.cab` file must be extracted to a folder and this folder path must be defined on this field.
957-
#[serde(alias = "webview-fixed-runtime-path")]
958-
pub webview_fixed_runtime_path: Option<PathBuf>,
959951
/// Validates a second app installation, blocking the user from installing an older version if set to `false`.
960952
///
961953
/// For instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`.
@@ -986,7 +978,6 @@ impl Default for WindowsConfig {
986978
timestamp_url: None,
987979
tsp: false,
988980
webview_install_mode: Default::default(),
989-
webview_fixed_runtime_path: None,
990981
allow_downgrades: true,
991982
wix: None,
992983
nsis: None,
@@ -2550,14 +2541,7 @@ mod build {
25502541

25512542
impl ToTokens for WindowsConfig {
25522543
fn to_tokens(&self, tokens: &mut TokenStream) {
2553-
let webview_install_mode = if let Some(fixed_runtime_path) = &self.webview_fixed_runtime_path
2554-
{
2555-
WebviewInstallMode::FixedRuntime {
2556-
path: fixed_runtime_path.clone(),
2557-
}
2558-
} else {
2559-
self.webview_install_mode.clone()
2560-
};
2544+
let webview_install_mode = &self.webview_install_mode;
25612545
tokens.append_all(quote! { ::tauri::utils::config::WindowsConfig {
25622546
webview_install_mode: #webview_install_mode,
25632547
..Default::default()

examples/api/src-tauri/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tooling/bundler/src/bundle/settings.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,6 @@ pub struct WindowsSettings {
494494
pub icon_path: PathBuf,
495495
/// The installation mode for the Webview2 runtime.
496496
pub webview_install_mode: WebviewInstallMode,
497-
/// Path to the webview fixed runtime to use.
498-
///
499-
/// Overwrites [`Self::webview_install_mode`] if set.
500-
///
501-
/// Will be removed in v2, use [`Self::webview_install_mode`] instead.
502-
pub webview_fixed_runtime_path: Option<PathBuf>,
503497
/// Validates a second app installation, blocking the user from installing an older version if set to `false`.
504498
///
505499
/// For instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`.
@@ -533,7 +527,6 @@ impl Default for WindowsSettings {
533527
nsis: None,
534528
icon_path: PathBuf::from("icons/icon.ico"),
535529
webview_install_mode: Default::default(),
536-
webview_fixed_runtime_path: None,
537530
allow_downgrades: true,
538531
sign_command: None,
539532
}

tooling/bundler/src/bundle/windows/msi/wix.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,7 @@ pub fn build_wix_app_installer(
435435
silent: silent_webview_install,
436436
}
437437
} else {
438-
let mut webview_install_mode = settings.windows().webview_install_mode.clone();
439-
if let Some(fixed_runtime_path) = settings.windows().webview_fixed_runtime_path.clone() {
440-
webview_install_mode = WebviewInstallMode::FixedRuntime {
441-
path: fixed_runtime_path,
442-
};
443-
}
444-
webview_install_mode
438+
settings.windows().webview_install_mode.clone()
445439
};
446440

447441
data.insert("install_webview", to_json(true));

tooling/bundler/src/bundle/windows/nsis.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,7 @@ fn build_nsis_app_installer(
427427
silent: silent_webview2_install,
428428
}
429429
} else {
430-
let mut webview_install_mode = settings.windows().webview_install_mode.clone();
431-
if let Some(fixed_runtime_path) = settings.windows().webview_fixed_runtime_path.clone() {
432-
webview_install_mode = WebviewInstallMode::FixedRuntime {
433-
path: fixed_runtime_path,
434-
};
435-
}
436-
webview_install_mode
430+
settings.windows().webview_install_mode.clone()
437431
};
438432

439433
let webview2_installer_args = to_json(if silent_webview2_install {

tooling/cli/schema.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
"signCommand": null,
121121
"timestampUrl": null,
122122
"tsp": false,
123-
"webviewFixedRuntimePath": null,
124123
"webviewInstallMode": {
125124
"silent": true,
126125
"type": "downloadBootstrapper"
@@ -1650,7 +1649,6 @@
16501649
"signCommand": null,
16511650
"timestampUrl": null,
16521651
"tsp": false,
1653-
"webviewFixedRuntimePath": null,
16541652
"webviewInstallMode": {
16551653
"silent": true,
16561654
"type": "downloadBootstrapper"
@@ -1998,13 +1996,6 @@
19981996
}
19991997
]
20001998
},
2001-
"webviewFixedRuntimePath": {
2002-
"description": "Path to the webview fixed runtime to use. Overwrites [`Self::webview_install_mode`] if set.\n\n Will be removed in v2, prefer the [`Self::webview_install_mode`] option.\n\n The fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section).\n The `.cab` file must be extracted to a folder and this folder path must be defined on this field.",
2003-
"type": [
2004-
"string",
2005-
"null"
2006-
]
2007-
},
20081999
"allowDowngrades": {
20092000
"description": "Validates a second app installation, blocking the user from installing an older version if set to `false`.\n\n For instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`.\n\n The default value of this flag is `true`.",
20102001
"default": true,

tooling/cli/src/interface/rust.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,7 @@ fn tauri_config_to_bundle_settings(
12801280

12811281
#[cfg(windows)]
12821282
{
1283-
if let Some(webview_fixed_runtime_path) = &config.windows.webview_fixed_runtime_path {
1284-
resources.push(webview_fixed_runtime_path.display().to_string());
1285-
} else if let crate::helpers::config::WebviewInstallMode::FixedRuntime { path } =
1283+
if let crate::helpers::config::WebviewInstallMode::FixedRuntime { path } =
12861284
&config.windows.webview_install_mode
12871285
{
12881286
resources.push(path.display().to_string());
@@ -1423,7 +1421,6 @@ fn tauri_config_to_bundle_settings(
14231421
nsis: config.windows.nsis.map(nsis_settings),
14241422
icon_path: windows_icon_path,
14251423
webview_install_mode: config.windows.webview_install_mode,
1426-
webview_fixed_runtime_path: config.windows.webview_fixed_runtime_path,
14271424
allow_downgrades: config.windows.allow_downgrades,
14281425
sign_command: config.windows.sign_command.map(custom_sign_settings),
14291426
},

0 commit comments

Comments
 (0)