为什么自定义 Wix 安装程序的标题不是粗体 UI?

Why is my title not bold for custom wix installer UI?

我创建了自己的安装程序向导页面,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi" >
    <Fragment>
        <UI>
            <Property Id="CUSTOM_PORT" Value="8080"/>

            <Dialog Id="ConfigurationDlg" Width="370" Height="270" Title="!(loc.BrowseDlg_Title)">

                <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
                    <!-- <Condition Action="disable"><![CDATA[ConfigurationIsValid <> "1"]]></Condition> -->
                    <!-- <Condition Action="enable">ConfigurationIsValid = "1"</Condition> -->
                </Control>
                <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
                <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
                    <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
                </Control>

                <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Choose settings to configure which affect your local server" />
                <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Application Configuration" />
                <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
                <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
                <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />

                <Control Id="Hint" Type="Text" X="26" Y="60" Width="250" Height="16" Transparent="yes" Text="Application Port"/>
                <Control Id="ConfigurationPort" Type="MaskedEdit" X="26" Y="76" Width="40" Height="16" Property="CUSTOM_PORT" Text="#####" Sunken="yes">
                    <Publish Event="DoAction" Value="VerifyConfigurationAction">1</Publish>
                </Control>

            </Dialog>
        </UI>
    </Fragment>
</Include>

布局和数据流很好,但由于某些原因,我的 Control Id="Title" 元素没有像默认 UI 页面那样以粗体显示。

我已经查看了其他默认页面的 source code,但没有看到任何解释为什么它不会按计划呈现的内容。

想要的外观:

当前外观:

看来,您已经找到了解决方案。最近遇到同样的问题,描述一下以防有人需要。

常用样式通常以这种方式存储在 UI 部分的主安装程序文件中:

<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

可以通过在文本 属性 的开头添加此样式来将此样式应用于控件,如下所示:

<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" 
         NoPrefix="yes" Text="{\WixUI_Font_Title}My title" />

如果使用本地化文件,则可以在其中添加样式:

<String Id="InstallDirDlgTitle">{\WixUI_Font_Title}My title</String>