Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23f7819

Browse files
authored
feat: added icon to installer's bootstrap application (#112)
Closes:#38 WiX 5 introduced a bug that stopped respecting the icon file on thetheme's Window. This is described in this issue:wixtoolset/issues#8104This PR introduces:- an additional option in our `build-bootstrapper` to allow optionalsetting of the `theme xml`,- adds a copy of the `RtfLargeTheme.xml` from WiX `5.0.2` with the addedattribute of `IconFile`![image](https://github.com/user-attachments/assets/cb73e9a9-7227-49ae-b5bd-b82423133f51)
1 parent5afd747 commit23f7819

File tree

3 files changed

+172
-0
lines changed

3 files changed

+172
-0
lines changed

‎Installer/Program.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ public class BootstrapperOptions : SharedOptions
119119
[Option('w',"windows-app-sdk-path",Required=true,HelpText="Path to the Windows App Sdk package to embed")]
120120
publicstringWindowsAppSdkPath{get;set;}
121121

122+
[Option('t',"theme-xml-path",Required=false,HelpText="Path to the theme .xml file to use for the installer")]
123+
publicstringThemeXmlPath{get;set;}
124+
122125
publicnewvoidValidate()
123126
{
124127
base.Validate();
@@ -130,6 +133,8 @@ public class BootstrapperOptions : SharedOptions
130133
if(!SystemFile.Exists(WindowsAppSdkPath))
131134
thrownewArgumentException($"Windows App Sdk package not found at '{WindowsAppSdkPath}'",
132135
nameof(WindowsAppSdkPath));
136+
if(ThemeXmlPath!=null&&!SystemFile.Exists(ThemeXmlPath))
137+
thrownewArgumentException($"Theme XML file not found at '{ThemeXmlPath}'",nameof(ThemeXmlPath));
133138
}
134139
}
135140

@@ -415,6 +420,20 @@ private static int BuildBundle(BootstrapperOptions opts)
415420
bundle.Application.LicensePath=opts.LicenseFile;
416421
bundle.Application.LogoFile=opts.LogoPng;
417422

423+
if(opts.ThemeXmlPath!=null)
424+
{
425+
bundle.Application.ThemeFile=opts.ThemeXmlPath;
426+
bundle.Application.Payloads=
427+
[
428+
newExePackagePayload
429+
{
430+
Name="icon.ico",
431+
SourceFile=opts.IconFile,
432+
Compressed=true,
433+
},
434+
];
435+
}
436+
418437
// Set the default install folder, which will eventually be passed into
419438
// the MSI.
420439
bundle.Variables=

‎scripts/Publish.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ $windowsAppSdkPath = Join-Path $scriptRoot "files\windows-app-sdk-$($arch).exe"
189189
--icon-file"App\coder.ico"`
190190
--msi-path$msiOutputPath`
191191
--windows-app-sdk-path$windowsAppSdkPath`
192+
--theme-xml-path"scripts\files\RtfThemeLarge.xml"`
192193
--logo-png"scripts\files\logo.png"
193194
if ($LASTEXITCODE-ne0) {throw"Failed to build bootstrapper" }
194195

‎scripts/files/RtfThemeLarge.xml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.-->
3+
<!--
4+
Copyright (c) .NET Foundation and contributors.
5+
This software is released under the Microsoft Reciprocal License (MS-RL) (the "License"); you may not use the software except in compliance with the License.
6+
7+
The text of the Microsoft Reciprocal License (MS-RL) can be found online at:
8+
http://opensource.org/licenses/ms-rl
9+
10+
11+
Microsoft Reciprocal License (MS-RL)
12+
13+
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
14+
15+
1. Definitions
16+
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
17+
A "contribution" is the original software, or any additions or changes to the software.
18+
A "contributor" is any person that distributes its contribution under this license.
19+
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
20+
21+
2. Grant of Rights
22+
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
23+
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
24+
25+
3. Conditions and Limitations
26+
(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
27+
(B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
28+
(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
29+
(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
30+
(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
31+
(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
32+
-->
33+
<!-- Downloaded from https://github.com/wixtoolset/wix/blob/v5.0.2/src/ext/Bal/stdbas/Resources/RtfLargeTheme.xml
34+
This needed to be modified, because WiX 5 introduced an issue that doesn't fill IconFile attribute on the main Window
35+
in the theme. WiX issue: https://github.com/wixtoolset/issues/issues/8104
36+
-->
37+
38+
<Themexmlns="http://wixtoolset.org/schemas/v4/thmutil">
39+
<FontId="0"Height="-12"Weight="500"Foreground="windowtext"Background="window">Segoe UI</Font>
40+
<FontId="1"Height="-24"Weight="500"Foreground="windowtext">Segoe UI</Font>
41+
<FontId="2"Height="-22"Weight="500"Foreground="graytext">Segoe UI</Font>
42+
<FontId="3"Height="-12"Weight="500"Foreground="windowtext"Background="window">Segoe UI</Font>
43+
44+
<WindowWidth="500"Height="390"HexStyle="100a0000"FontId="0"Caption="#(loc.Caption)"IconFile="icon.ico">
45+
<ImageControlX="11"Y="11"Width="64"Height="64"ImageFile="logo.png"Visible="yes"/>
46+
<LabelX="80"Y="11"Width="-11"Height="64"FontId="1"Visible="yes"DisablePrefix="yes">#(loc.Title)</Label>
47+
48+
<PageName="Help">
49+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes">#(loc.HelpHeader)</Label>
50+
<LabelX="11"Y="112"Width="-11"Height="-35"FontId="3"DisablePrefix="yes">#(loc.HelpText)</Label>
51+
<ButtonName="HelpCloseButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
52+
<Text>#(loc.HelpCloseButton)</Text>
53+
<CloseWindowAction />
54+
</Button>
55+
</Page>
56+
<PageName="Loading">
57+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes"Visible="no"Name="CheckingForUpdatesLabel" />
58+
</Page>
59+
<PageName="Install">
60+
<LabelX="11"Y="80"Width="-11"Height="-70"TabStop="no"FontId="2"HexStyle="800000"DisablePrefix="yes" />
61+
<RicheditName="EulaRichedit"X="12"Y="81"Width="-12"Height="-71"TabStop="yes"FontId="0" />
62+
<LabelName="InstallVersion"X="11"Y="-41"Width="210"Height="17"FontId="3"DisablePrefix="yes"VisibleCondition="WixStdBAShowVersion">#(loc.InstallVersion)</Label>
63+
<CheckboxName="EulaAcceptCheckbox"X="-11"Y="-41"Width="260"Height="17"TabStop="yes"FontId="3"HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
64+
<ButtonName="InstallUpdateButton"X="11"Y="-11"Width="200"Height="23"TabStop="yes"FontId="0"EnableCondition="WixStdBAUpdateAvailable"HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
65+
<ButtonName="OptionsButton"X="-171"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0"VisibleCondition="NOT WixStdBASuppressOptionsUI">
66+
<Text>#(loc.InstallOptionsButton)</Text>
67+
<ChangePageActionPage="Options" />
68+
</Button>
69+
<ButtonName="InstallButton"X="-91"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">#(loc.InstallInstallButton)</Button>
70+
<ButtonName="InstallCancelButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
71+
<Text>#(loc.InstallCancelButton)</Text>
72+
<CloseWindowAction />
73+
</Button>
74+
</Page>
75+
<PageName="Options">
76+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes">#(loc.OptionsHeader)</Label>
77+
<LabelX="11"Y="121"Width="-11"Height="17"FontId="3"DisablePrefix="yes">#(loc.OptionsLocationLabel)</Label>
78+
<EditboxName="InstallFolder"X="11"Y="143"Width="-91"Height="21"TabStop="yes"FontId="3"FileSystemAutoComplete="yes" />
79+
<ButtonName="BrowseButton"X="-11"Y="142"Width="75"Height="23"TabStop="yes"FontId="3">
80+
<Text>#(loc.OptionsBrowseButton)</Text>
81+
<BrowseDirectoryActionVariableName="InstallFolder" />
82+
</Button>
83+
<ButtonName="OptionsOkButton"X="-91"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
84+
<Text>#(loc.OptionsOkButton)</Text>
85+
<ChangePageActionPage="Install" />
86+
</Button>
87+
<ButtonName="OptionsCancelButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
88+
<Text>#(loc.OptionsCancelButton)</Text>
89+
<ChangePageActionPage="Install"Cancel="yes" />
90+
</Button>
91+
</Page>
92+
<PageName="Progress">
93+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes">#(loc.ProgressHeader)</Label>
94+
<LabelX="11"Y="121"Width="70"Height="17"FontId="3"DisablePrefix="yes">#(loc.ProgressLabel)</Label>
95+
<LabelName="OverallProgressPackageText"X="85"Y="121"Width="-11"Height="17"FontId="3"DisablePrefix="yes">#(loc.OverallProgressPackageText)</Label>
96+
<ProgressbarName="OverallCalculatedProgressbar"X="11"Y="143"Width="-11"Height="15" />
97+
<ButtonName="ProgressCancelButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">#(loc.ProgressCancelButton)</Button>
98+
</Page>
99+
<PageName="Modify">
100+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes">#(loc.ModifyHeader)</Label>
101+
<ButtonName="ModifyUpdateButton"X="11"Y="-11"Width="200"Height="23"TabStop="yes"FontId="0"EnableCondition="WixStdBAUpdateAvailable"HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
102+
<ButtonName="RepairButton"X="-171"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0"HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
103+
<ButtonName="UninstallButton"X="-91"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">#(loc.ModifyUninstallButton)</Button>
104+
<ButtonName="ModifyCancelButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
105+
<Text>#(loc.ModifyCancelButton)</Text>
106+
<CloseWindowAction />
107+
</Button>
108+
</Page>
109+
<PageName="Success">
110+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes">
111+
<Text>#(loc.SuccessHeader)</Text>
112+
<TextCondition="WixBundleAction = 2">#(loc.SuccessLayoutHeader)</Text>
113+
<TextCondition="WixBundleAction = 3">#(loc.SuccessUnsafeUninstallHeader)</Text>
114+
<TextCondition="WixBundleAction = 4">#(loc.SuccessUninstallHeader)</Text>
115+
<TextCondition="WixBundleAction = 5">#(loc.SuccessCacheHeader)</Text>
116+
<TextCondition="WixBundleAction = 6">#(loc.SuccessInstallHeader)</Text>
117+
<TextCondition="WixBundleAction = 7">#(loc.SuccessModifyHeader)</Text>
118+
<TextCondition="WixBundleAction = 8">#(loc.SuccessRepairHeader)</Text>
119+
</Label>
120+
<ButtonName="LaunchButton"X="-91"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0"HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
121+
<LabelX="-11"Y="-51"Width="400"Height="34"FontId="3"DisablePrefix="yes"VisibleCondition="WixStdBARestartRequired">
122+
<Text>#(loc.SuccessRestartText)</Text>
123+
<TextCondition="WixBundleAction = 3">#(loc.SuccessUninstallRestartText)</Text>
124+
</Label>
125+
<ButtonName="SuccessRestartButton"X="-91"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0"HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
126+
<ButtonName="SuccessCloseButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
127+
<Text>#(loc.SuccessCloseButton)</Text>
128+
<CloseWindowAction />
129+
</Button>
130+
</Page>
131+
<PageName="Failure">
132+
<LabelX="11"Y="80"Width="-11"Height="30"FontId="2"DisablePrefix="yes">
133+
<Text>#(loc.FailureHeader)</Text>
134+
<TextCondition="WixBundleAction = 2">#(loc.FailureLayoutHeader)</Text>
135+
<TextCondition="WixBundleAction = 3">#(loc.FailureUnsafeUninstallHeader)</Text>
136+
<TextCondition="WixBundleAction = 4">#(loc.FailureUninstallHeader)</Text>
137+
<TextCondition="WixBundleAction = 5">#(loc.FailureCacheHeader)</Text>
138+
<TextCondition="WixBundleAction = 6">#(loc.FailureInstallHeader)</Text>
139+
<TextCondition="WixBundleAction = 7">#(loc.FailureModifyHeader)</Text>
140+
<TextCondition="WixBundleAction = 8">#(loc.FailureRepairHeader)</Text>
141+
</Label>
142+
<HypertextName="FailureLogFileLink"X="11"Y="121"Width="-11"Height="42"FontId="3"TabStop="yes"HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
143+
<HypertextName="FailureMessageText"X="22"Y="163"Width="-11"Height="51"FontId="3"TabStop="yes"HideWhenDisabled="yes" />
144+
<LabelName="FailureRestartText"X="-11"Y="-51"Width="400"Height="34"FontId="3"HideWhenDisabled="yes"DisablePrefix="yes">#(loc.FailureRestartText)</Label>
145+
<ButtonName="FailureRestartButton"X="-91"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0"HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
146+
<ButtonName="FailureCloseButton"X="-11"Y="-11"Width="75"Height="23"TabStop="yes"FontId="0">
147+
<Text>#(loc.FailureCloseButton)</Text>
148+
<CloseWindowAction />
149+
</Button>
150+
</Page>
151+
</Window>
152+
</Theme>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp