Skip to content

Commit 9bfdeb4

Browse files
authored
feat(bundler): add config for WiX dialog image path (#2449)
1 parent cd55d67 commit 9bfdeb4

File tree

9 files changed

+46
-1
lines changed

9 files changed

+46
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": patch
3+
---
4+
5+
Added `dialog_image_path` field to the `WixSettings` struct.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cli.rs": patch
3+
---
4+
5+
Added configuration for the WiX dialog background bitmap under `tauri.conf.json > tauri > bundle > windows > wix > dialogImagePath`.

docs/api/config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ In addition to the JSON defined on the `tauri.conf.json` file, Tauri reads a pla
176176
{ property: "mergeRefs", optional: true, type: "string[]", description: `The Merge element ids you want to reference from the fragments.` },
177177
{ property: "skipWebviewInstall", optional: true, type: "boolean", description: `Disables the Webview2 runtime installation after app install.` },
178178
{ 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.` },
179-
{ 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.` }]} />
179+
{ 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.` },
180+
{ 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.` }]} />
180181
}
181182
]} />
182183
},

tooling/bundler/src/bundle/settings.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ pub struct WixSettings {
205205
///
206206
/// The required dimensions are 493px × 58px.
207207
pub banner_path: Option<PathBuf>,
208+
/// Path to a bitmap file to use on the installation user interface dialogs.
209+
/// It is used on the welcome and completion dialogs.
210+
211+
/// The required dimensions are 493px × 312px.
212+
pub dialog_image_path: Option<PathBuf>,
208213
}
209214

210215
/// The Windows bundle settings.

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,19 @@ pub fn build_wix_app_installer(
546546
to_json(copy_icon(settings, &filename, banner_path)?),
547547
);
548548
}
549+
550+
if let Some(dialog_image_path) = &wix.dialog_image_path {
551+
let filename = dialog_image_path
552+
.file_name()
553+
.unwrap()
554+
.to_string_lossy()
555+
.into_owned()
556+
.to_string();
557+
data.insert(
558+
"dialog_image_path",
559+
to_json(copy_icon(settings, &filename, dialog_image_path)?),
560+
);
561+
}
549562
}
550563

551564
if !has_custom_template {

tooling/bundler/src/bundle/windows/templates/main.wxs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
{{#if banner_path}}
3535
<WixVariable Id="WixUIBannerBmp" Value="{{{banner_path}}}" />
3636
{{/if}}
37+
{{#if dialog_image_path}}
38+
<WixVariable Id="WixUIDialogBmp" Value="{{{dialog_image_path}}}" />
39+
{{/if}}
3740
{{#if license}}
3841
<WixVariable Id="WixUILicenseRtf" Value="{{{license}}}" />
3942
{{/if}}

tooling/cli.rs/config_definition.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ pub struct WixConfig {
8989
///
9090
/// The required dimensions are 493px × 58px.
9191
pub banner_path: Option<PathBuf>,
92+
/// Path to a bitmap file to use on the installation user interface dialogs.
93+
/// It is used on the welcome and completion dialogs.
94+
95+
/// The required dimensions are 493px × 312px.
96+
pub dialog_image_path: Option<PathBuf>,
9297
}
9398

9499
#[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize, JsonSchema)]

tooling/cli.rs/schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,13 @@
13451345
"type": "string"
13461346
}
13471347
},
1348+
"dialogImagePath": {
1349+
"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.",
1350+
"type": [
1351+
"string",
1352+
"null"
1353+
]
1354+
},
13481355
"enableElevatedUpdateTask": {
13491356
"default": false,
13501357
"type": "boolean"

tooling/cli.rs/src/helpers/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ impl From<WixConfig> for tauri_bundler::WixSettings {
2626
license: config.license,
2727
enable_elevated_update_task: config.enable_elevated_update_task,
2828
banner_path: config.banner_path,
29+
dialog_image_path: config.dialog_image_path,
2930
}
3031
}
3132
}

0 commit comments

Comments
 (0)