代码之家  ›  专栏  ›  技术社区  ›  Eva FP

使用自定义主题时,wix引导程序不显示许可证

wix
  •  0
  • Eva FP  · 技术社区  · 6 年前

    我在用 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>
    

    主题文件如下:

    <?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 回复  |  直到 6 年前
        1
  •  1
  •   Brian Sutherland    6 年前

    我重新阅读了您希望在安装页面之后添加许可协议,但不修改boosttrapper应用程序,这是不可能的。

    如果您真的想修改bootstrapper应用程序到这个程度,您将需要从github下载wix3源代码,并开始理解wixstdba.vcxproj并将其修改到您自己的ba中,以定义一个新的ui流。


    您的主题没有eula丰富的编辑框定义,因此不会显示。

    因为您正在使用(我假设)默认的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 以及一个名为 EulaAcceptCheckbox . 此外,主题中的任何交互式ui元素 必须 保持相同的名称,否则它们在引导程序中不起作用。在这种情况下,如果没有复选框,安装按钮将永远禁用。

    这是使用内置引导程序而不编写自己的限制。在不修改引导程序应用程序代码的情况下,您也不能添加任何新按钮。你基本上只限于移动ui元素(如果你真的想的话)和添加静态文本和复选框,也许还有可编辑的文本框。