在 Wixsharp 中更改横幅文本的颜色
Change color on banner text in Wixsharp
使用默认设置时是否可以更改横幅中显示的文本颜色WiXUI_Minimal,或者我是否必须添加自定义对话框?
我是这样解决的
project.BannerImage = "black_banner.jpg";
project.LocalizationFile = "default.wxs";
project.WixSourceGenerated += Project_WixSourceGenerated;
...
private static void Project_WixSourceGenerated(XDocument document)
{
var product = document.Select("Wix/Product");
var ui = product.AddElement("UI");
// Banner Title
ui.Add(new XElement("TextStyle",
new XAttribute("Id", "White12"),
new XAttribute("FaceName", "Tahoma"),
new XAttribute("Size", "12"),
new XAttribute("Red", "255"),
new XAttribute("Green", "255"),
new XAttribute("Blue", "255")));
// Banner description
ui.Add(new XElement("TextStyle",
new XAttribute("Id", "White8"),
new XAttribute("FaceName", "Tahoma"),
new XAttribute("Size", "8"),
new XAttribute("Red", "255"),
new XAttribute("Green", "255"),
new XAttribute("Blue", "255")));
}
然后我将其添加到文件中 default.wxs
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="InstallDirDlgTitle" Overridable="yes">{\White12}Destination Folder</String>
<String Id="InstallDirDlgDescription" Overridable="yes">{\White8}Click Next to install to the default folder or click Change to choose another.</String>
<String Id="LicenseAgreementDlgDescription" Overridable="yes">{\White8}Please read the following license agreement carefully</String>
<String Id="LicenseAgreementDlgTitle" Overridable="yes">{\White12}End User License Agreement</String>
<String Id="MaintenanceTypeDlgDescription" Overridable="yes">{\White8}Select the operation you whish to perform.</String>
<String Id="MaintenanceTypeDlgTitle" Overridable="yes">{\White12}Change, repair, or remove installation</String>
<String Id="ProgressDlgTitleInstalling" Overridable="yes">{\White12}Installing [ProductName]</String>
<String Id="VerifyReadyDlgInstallTitle" Overridable="yes">{\White12}Ready to Install [ProductName]</String>
<String Id="VerifyReadyDlgRepairTitle" Overridable="yes">{\White12}Ready to repair [ProductName]</String>
<String Id="VerifyReadyDlgRemoveTitle" Overridable="yes">{\White12}Ready to remove [ProductName]</String>
</WixLocalization>
使用默认设置时是否可以更改横幅中显示的文本颜色WiXUI_Minimal,或者我是否必须添加自定义对话框?
我是这样解决的
project.BannerImage = "black_banner.jpg";
project.LocalizationFile = "default.wxs";
project.WixSourceGenerated += Project_WixSourceGenerated;
...
private static void Project_WixSourceGenerated(XDocument document)
{
var product = document.Select("Wix/Product");
var ui = product.AddElement("UI");
// Banner Title
ui.Add(new XElement("TextStyle",
new XAttribute("Id", "White12"),
new XAttribute("FaceName", "Tahoma"),
new XAttribute("Size", "12"),
new XAttribute("Red", "255"),
new XAttribute("Green", "255"),
new XAttribute("Blue", "255")));
// Banner description
ui.Add(new XElement("TextStyle",
new XAttribute("Id", "White8"),
new XAttribute("FaceName", "Tahoma"),
new XAttribute("Size", "8"),
new XAttribute("Red", "255"),
new XAttribute("Green", "255"),
new XAttribute("Blue", "255")));
}
然后我将其添加到文件中 default.wxs
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="InstallDirDlgTitle" Overridable="yes">{\White12}Destination Folder</String>
<String Id="InstallDirDlgDescription" Overridable="yes">{\White8}Click Next to install to the default folder or click Change to choose another.</String>
<String Id="LicenseAgreementDlgDescription" Overridable="yes">{\White8}Please read the following license agreement carefully</String>
<String Id="LicenseAgreementDlgTitle" Overridable="yes">{\White12}End User License Agreement</String>
<String Id="MaintenanceTypeDlgDescription" Overridable="yes">{\White8}Select the operation you whish to perform.</String>
<String Id="MaintenanceTypeDlgTitle" Overridable="yes">{\White12}Change, repair, or remove installation</String>
<String Id="ProgressDlgTitleInstalling" Overridable="yes">{\White12}Installing [ProductName]</String>
<String Id="VerifyReadyDlgInstallTitle" Overridable="yes">{\White12}Ready to Install [ProductName]</String>
<String Id="VerifyReadyDlgRepairTitle" Overridable="yes">{\White12}Ready to repair [ProductName]</String>
<String Id="VerifyReadyDlgRemoveTitle" Overridable="yes">{\White12}Ready to remove [ProductName]</String>
</WixLocalization>