feat(bundler): add config for WiX dialog image path (#2449)

This commit is contained in:
Lucas Fernandes Nogueira 2021-08-16 12:03:00 -03:00 committed by GitHub
parent cd55d67149
commit 9bfdeb42ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-bundler": patch
---
Added `dialog_image_path` field to the `WixSettings` struct.

View File

@ -0,0 +1,5 @@
---
"cli.rs": patch
---
Added configuration for the WiX dialog background bitmap under `tauri.conf.json > tauri > bundle > windows > wix > dialogImagePath`.

View File

@ -176,7 +176,8 @@ In addition to the JSON defined on the `tauri.conf.json` file, Tauri reads a pla
{ property: "mergeRefs", optional: true, type: "string[]", description: `The Merge element ids you want to reference from the fragments.` },
{ property: "skipWebviewInstall", optional: true, type: "boolean", description: `Disables the Webview2 runtime installation after app install.` },
{ property: "license", optional: true, type: "string", description: `The path to the license file to render on the installer. Must be an RTF file, so if a different extension is provided, we convert it to the RTF format.` },
{ property: "bannerPath", optional: true, type: "string", description: `Path to a bitmap file to use as the installation user interface banner. This bitmap will appear at the top of all but the first page of the installer. The required dimensions are 493px × 58px.` }]} />
{ property: "bannerPath", optional: true, type: "string", description: `Path to a bitmap file to use as the installation user interface banner. This bitmap will appear at the top of all but the first page of the installer. The required dimensions are 493px × 58px.` },
{ property: "dialogImagePath", optional: true, type: "string", description: `Path to a bitmap file to use on the installation user interface dialogs. It is used on the welcome and completion dialogs. The required dimensions are 493px × 312px.` }]} />
}
]} />
},

View File

@ -205,6 +205,11 @@ pub struct WixSettings {
///
/// The required dimensions are 493px × 58px.
pub banner_path: Option<PathBuf>,
/// Path to a bitmap file to use on the installation user interface dialogs.
/// It is used on the welcome and completion dialogs.
/// The required dimensions are 493px × 312px.
pub dialog_image_path: Option<PathBuf>,
}
/// The Windows bundle settings.

View File

@ -546,6 +546,19 @@ pub fn build_wix_app_installer(
to_json(copy_icon(settings, &filename, banner_path)?),
);
}
if let Some(dialog_image_path) = &wix.dialog_image_path {
let filename = dialog_image_path
.file_name()
.unwrap()
.to_string_lossy()
.into_owned()
.to_string();
data.insert(
"dialog_image_path",
to_json(copy_icon(settings, &filename, dialog_image_path)?),
);
}
}
if !has_custom_template {

View File

@ -34,6 +34,9 @@
{{#if banner_path}}
<WixVariable Id="WixUIBannerBmp" Value="{{{banner_path}}}" />
{{/if}}
{{#if dialog_image_path}}
<WixVariable Id="WixUIDialogBmp" Value="{{{dialog_image_path}}}" />
{{/if}}
{{#if license}}
<WixVariable Id="WixUILicenseRtf" Value="{{{license}}}" />
{{/if}}

View File

@ -89,6 +89,11 @@ pub struct WixConfig {
///
/// The required dimensions are 493px × 58px.
pub banner_path: Option<PathBuf>,
/// Path to a bitmap file to use on the installation user interface dialogs.
/// It is used on the welcome and completion dialogs.
/// The required dimensions are 493px × 312px.
pub dialog_image_path: Option<PathBuf>,
}
#[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize, JsonSchema)]

View File

@ -1345,6 +1345,13 @@
"type": "string"
}
},
"dialogImagePath": {
"description": "Path to a bitmap file to use on the installation user interface dialogs. It is used on the welcome and completion dialogs. The required dimensions are 493px × 312px.",
"type": [
"string",
"null"
]
},
"enableElevatedUpdateTask": {
"default": false,
"type": "boolean"

View File

@ -26,6 +26,7 @@ impl From<WixConfig> for tauri_bundler::WixSettings {
license: config.license,
enable_elevated_update_task: config.enable_elevated_update_task,
banner_path: config.banner_path,
dialog_image_path: config.dialog_image_path,
}
}
}