Wix 引导程序在使用自定义主题时不显示许可证
Wix bootstrapper doesn't show license when using a custom theme
我正在使用带有自定义主题的 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
页面之后立即显示许可协议页面。有什么建议吗?
提前致谢!
我重新读到你想在安装页面后添加许可协议,但不修改 boostrapper 应用程序,这是不可能的。
如果您真的想将引导程序应用程序修改到那种程度,您将需要从 github 下载 wix3 源代码并着手理解 WixStdBA.vcxproj 并将其修改为您自己的 BA定义一个新的 UI 流程。
您的主题没有丰富的 eula 编辑框定义,因此不会显示。
由于您正在使用(我假设)默认 WixStdBA.dll 并且正在使用默认主题之一,因此您需要遵循其结构以利用他们使用的 UI 元素.您可以添加一些元素,例如复选框,我认为是文本框,但就其他交互式 UI 元素而言,您有点受限。
Here 是原始 RTFLicense 主题的 link。
注意他们的安装页面:
<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 元素(如果您真的想要)并添加静态文本和复选框以及可能的可编辑文本框。
我正在使用带有自定义主题的 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
页面之后立即显示许可协议页面。有什么建议吗?
提前致谢!
我重新读到你想在安装页面后添加许可协议,但不修改 boostrapper 应用程序,这是不可能的。
如果您真的想将引导程序应用程序修改到那种程度,您将需要从 github 下载 wix3 源代码并着手理解 WixStdBA.vcxproj 并将其修改为您自己的 BA定义一个新的 UI 流程。
您的主题没有丰富的 eula 编辑框定义,因此不会显示。
由于您正在使用(我假设)默认 WixStdBA.dll 并且正在使用默认主题之一,因此您需要遵循其结构以利用他们使用的 UI 元素.您可以添加一些元素,例如复选框,我认为是文本框,但就其他交互式 UI 元素而言,您有点受限。
Here 是原始 RTFLicense 主题的 link。
注意他们的安装页面:
<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 元素(如果您真的想要)并添加静态文本和复选框以及可能的可编辑文本框。