在上一篇中,留下了许可协议的问题,目前已经解决。感谢网友武全的指点!

问题

         一般我们是用WixVariable 来设定许可协议。如下所示:  

  <WixVariable Id="WixUILicenseRtf" Value="license.rtf" />

      但在多语言中我们写成下面这样是不识别的。它会被直接当成文件路径,而报错,找不到文件。

   <WixVariable Id="WixUILicenseRtf" Value="!(loc.LicenseRtf)" />

string:

 <String Id="LicenseRtf">Languages\license.rtf</String>

Wix 安装部署教程(十四) -- 多语言安装包之用户许可协议

自定义CustomLicenseDlg

这样我们需要自定义一个许可证书对话框。不过我们可以在源码的基础上稍作修改。在源码中找到LicenseAgreementDlg.wxs。

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <Dialog Id="LicenseAgreementDlg" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)">
                <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" />
                <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="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgDescription)" />
                <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgTitle)" />
                <Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="207" Width="330" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.LicenseAgreementDlgLicenseAcceptedCheckBox)" />
                <Control Id="Print" Type="PushButton" X="112" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
                    <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
                </Control>
                <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
                <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
                    <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
                    <Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
                    <Condition Action="enable">LicenseAccepted = "1"</Condition>
                </Control>
                <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="LicenseText" Type="ScrollableText" X="20" Y="60" Width="330" Height="140" Sunken="yes" TabSkip="no">
                    <Text SourceFile="!(wix.WixUILicenseRtf=$(var.licenseRtf))" />
                </Control>
            </Dialog>
        </UI>
    </Fragment>
</Wix>
View Code

相关文章:

  • 2021-06-21
  • 2022-03-05
  • 2022-03-04
  • 2022-12-23
  • 2021-10-25
  • 2021-07-27
  • 2021-09-28
猜你喜欢
  • 2021-12-18
  • 2021-06-29
  • 2022-12-23
  • 2021-09-04
  • 2021-08-30
相关资源
相似解决方案