使用自定义主题时,Wix bootstrapper不显示许可证

时间:2018-05-30 09:13:28

标签: wix

我使用带有自定义主题的WixBootstrapperApplicationRef来显示许可证。我已将此主题添加为有效负载,如我在this post中所见,但如果我添加自定义主题,则不会显示许可协议。

我使用的代码如下:

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
  <Payload SourceFile="..\..\..\Libraries\InstallerFiles\graphics\UIDialog.bmp"/>
  <Payload SourceFile="..\..\..\Libraries\InstallerFiles\graphics\UIBanner.bmp"/>
  <Payload SourceFile="..\..\..\Libraries\InstallerFiles\graphics\UIBanner2.bmp"/>
  <Payload SourceFile="..\..\..\Libraries\InstallerFiles\graphics\CoreTheme.xml"/>
  <bal:WixStandardBootstrapperApplication LicenseFile="..\..\..\Libraries\InstallerFiles\licenses\License Agreement_Test.rtf" SuppressOptionsUI="yes" ThemeFile="..\..\..\Libraries\InstallerFiles\graphics\CoreTheme.xml" />
</BootstrapperApplicationRef>

ThemeFile看起来像这样:

<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
  <Window Width="500" Height="390" HexStyle="100a0000" FontId="0">[WixBundleName] Setup Wizard.</Window>
  <Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="FFFFFF">Segoe UI</Font>
  <Font Id="1" Height="-18" Weight="575" Foreground="000000">Segoe UI</Font>
  <Font Id="2" Height="-16" Weight="500" Foreground="000000">Segoe UI</Font>
  <Page Name="Install">
    <Text X="175" Y="11" Width="-11" Height="64" FontId="1">Welcome to the [WixBundleName] Setup Wizard</Text>
    <Image X="0" Y="0" Width="164" Height="312" ImageFile="UIDialog.bmp" />
    <Static Height="1" Width="-0" X="0" Y="312" Visible="yes" />
    <Text Name="Welcome" X="175" Y="90" Width="-11" Height="51" FontId="0">This Setup Wizard will install [WixBundleName] on your computer.</Text>
    <Text Name="Welcome" X="175" Y="141" Width="-11" Height="51" FontId="0">It is recommended that you close all other applications before continuing.</Text>
    <Text Name="Welcome" X="175" Y="192" Width="-11" Height="51" FontId="0">Click Install to continue, or Close to exit the Setup Wizard.</Text>
    <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
    <Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
  </Page>
  <Page Name="Progress">
    <Image X="0" Y="0" Width="493" Height="58" ImageFile="UIBanner2.bmp" />
    <Static Height="1" Width="-0" X="0" Y="312" Visible="yes" />
    <Text X="11" Y="11" Width="-11" Height="64" FontId="1">[WixBundleName] Setup Wizard</Text>
    <Static Height="1" Width="-0" X="0" Y="58" />
    <Text X="11" Y="120" Width="-11" Height="25" FontId="2">#(loc.ProgressHeader)</Text>
    <Text X="11" Y="161" Width="70" Height="17" FontId="0">#(loc.ProgressLabel)</Text>
    <Text Name="OverallProgressPackageText" X="85" Y="161" Width="-11" Height="17" FontId="0">#(loc.OverallProgressPackageText)</Text>
    <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="183" Width="-11" Height="15" />
    <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
  </Page>
  <Page Name="Modify">
    <Text X="175" Y="11" Width="-11" Height="64" FontId="1">Welcome to the [WixBundleName] Setup Wizard.</Text>
    <Image X="0" Y="0" Width="164" Height="312" ImageFile="UIDialog.bmp" />
    <Static Height="1" Width="-0" X="0" Y="312" Visible="yes" />
    <Text X="175" Y="90" Width="-11" Height="51" FontId="0">The Setup Wizard allows you to remove the [WixBundleName] features from your computer.</Text>
    <Text X="175" Y="141" Width="-11" Height="51" FontId="0">Click Uninstall to continue, or Close to exit the Setup Wizard.</Text>
    <Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
    <Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyCloseButton)</Button>
  </Page>
  <Page Name="Success">
    <Text X="175" Y="11" Width="-11" Height="64" FontId="1">Completed the [WixBundleName] Setup Wizard.</Text>
    <Image X="0" Y="0" Width="164" Height="312" ImageFile="UIDialog.bmp" />
    <Static Height="1" Width="-0" X="0" Y="312" Visible="yes" />
    <Text X="175" Y="90" Width="-11" Height="51" FontId="0">Click the Close button to exit the Setup Wizard</Text>
    <Button Name="SuccessCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.SuccessCloseButton)</Button>
  </Page>
  <Page Name="Failure">
    <Text X="175" Y="11" Width="-11" Height="64" FontId="1">The [WixBundleName] Setup Wizard was interrupted.</Text>
    <Image X="0" Y="0" Width="164" Height="312" ImageFile="UIDialog.bmp" />
    <Static Height="1" Width="-0" X="0" Y="312" Visible="yes" />
    <Text Name="FailureText" X="175" Y="90" Width="-11" Height="71" FontId="0">
      The [WixBundleName] Setup was interrupted. Your system has not been modified. To install this program at a later time, please run the installation again. Refer to the installation manual for further instructions.
    </Text>
    <Text Name="FailureMessageText" X="175" Y="161" Width="-11" Height="80" FontId="0" HideWhenDisabled="yes" />
    <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.FailureCloseButton)</Button>
  </Page>
</Theme>

我想要实现的是在Install页面后面显示“许可协议”页面。有什么建议吗?

提前致谢!

1 个答案:

答案 0 :(得分:1)

我重读您想要在安装页面之后添加许可协议但不修改boostrapper应用程序,这是不可能的。

如果你真的想要将bootstrapper应用程序修改到那个程度,你需要从github下载wix3源代码并开始理解WixStdBA.vcxproj并将其修改为你自己的BA来定义新的UI流程。

<小时/>

您的主题没有丰富的编辑框定义,因此无法显示。

由于您正在使用(我假设)默认的WixStdBA.dll并且正在使用其中一个默认主题,您需要按照其结构来使用他们使用的UI元素。你可以添加一些像复选框这样的元素,我认为是文本框,但只要它与其他交互式UI元素一样,你就会受到限制。

Here是原始RTFLicense主题的链接。

注意他们的安装页面:

<Page Name="Install">
    <Richedit Name="EulaRichedit" X="11" Y="80" Width="-11" Height="-70" TabStop="yes" FontId="0" HexStyle="0x800000" />
    <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
    <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.InstallOptionsButton)</Button>
    <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
    <Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
</Page>

如果您希望在首页上显示EULA,则必须添加名为EulaRichedit的Richedit以及名为EulaAcceptCheckbox的复选框。此外,主题中的任何交互式UI元素必须保持相同的名称,否则它们将无法在您的引导程序中运行。在这种情况下,如果您没有复选框,则会永久禁用“安装”按钮。

这是使用内置引导程序而不编写自己的引导程序的限制。您也无法添加新的按钮,无需修改自己的引导程序应用程序代码。您基本上只能移动UI元素(如果您真的想要)并添加静态文本和复选框以及可编辑的文本框。