mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-28 12:27:16 +03:00
This commit is contained in:
parent
73a08abba8
commit
d13afec204
5
.changes/wix-skip-webview-install.md
Normal file
5
.changes/wix-skip-webview-install.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch
|
||||
---
|
||||
|
||||
Adds `skip_webview_install` config under `windows > wix` to disable Webview2 runtime installation after the app install.
|
@ -184,6 +184,8 @@ pub struct WixSettings {
|
||||
pub feature_refs: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub merge_refs: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub skip_webview_install: bool,
|
||||
}
|
||||
|
||||
/// The Windows bundle settings.
|
||||
|
@ -175,6 +175,7 @@
|
||||
{{/each~}}
|
||||
</Feature>
|
||||
|
||||
{{#if install_webview}}
|
||||
<!-- WebView2 -->
|
||||
<Property Id="WVRTINSTALLED">
|
||||
<RegistrySearch Id="WVRTInstalled" Root="HKLM" Key="SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Name="pv" Type="raw" Win64="no"/>
|
||||
@ -185,6 +186,7 @@
|
||||
<![CDATA[NOT(REMOVE OR WVRTINSTALLED)]]>
|
||||
</Custom>
|
||||
</InstallExecuteSequence>
|
||||
{{/if}}
|
||||
|
||||
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
|
||||
</Product>
|
||||
|
@ -466,6 +466,7 @@ pub fn build_wix_app_installer(
|
||||
let mut fragment_paths = Vec::new();
|
||||
let mut handlebars = Handlebars::new();
|
||||
let mut has_custom_template = false;
|
||||
let mut install_webview = true;
|
||||
|
||||
if let Some(wix) = &settings.windows().wix {
|
||||
data.insert("component_group_refs", to_json(&wix.component_group_refs));
|
||||
@ -474,6 +475,7 @@ pub fn build_wix_app_installer(
|
||||
data.insert("feature_refs", to_json(&wix.feature_refs));
|
||||
data.insert("merge_refs", to_json(&wix.merge_refs));
|
||||
fragment_paths = wix.fragment_paths.clone();
|
||||
install_webview = !wix.skip_webview_install;
|
||||
|
||||
if let Some(temp_path) = &wix.template {
|
||||
let template = std::fs::read_to_string(temp_path)?;
|
||||
@ -490,7 +492,11 @@ pub fn build_wix_app_installer(
|
||||
.register_template_string("main.wxs", include_str!("templates/main.wxs"))
|
||||
.map_err(|e| e.to_string())
|
||||
.expect("Failed to setup handlebar template");
|
||||
};
|
||||
}
|
||||
|
||||
if install_webview {
|
||||
data.insert("install_webview", to_json(true));
|
||||
}
|
||||
|
||||
if output_path.exists() {
|
||||
remove_dir_all(&output_path)?;
|
||||
|
@ -57,6 +57,8 @@ pub struct WixConfig {
|
||||
pub feature_refs: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub merge_refs: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub skip_webview_install: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize, JsonSchema)]
|
||||
|
@ -1221,6 +1221,10 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"skipWebviewInstall": {
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"template": {
|
||||
"type": [
|
||||
"string",
|
||||
|
@ -23,6 +23,7 @@ impl From<WixConfig> for tauri_bundler::WixSettings {
|
||||
feature_group_refs: config.feature_group_refs,
|
||||
feature_refs: config.feature_refs,
|
||||
merge_refs: config.merge_refs,
|
||||
skip_webview_install: config.skip_webview_install,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user