2017-02-20 66 views

回答

0

我设法解决这个问题。

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>