问题描述
我正在创建一个包含两个 msi 包的 wix bootstrap 应用程序。下面是 bootstrap bundle.wxs 文件的代码:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="WixDemoSetupDefaultUI"
Version="1.0.0.0" Manufacturer="Priom"
UpgradeCode="7c77bd1b-fb15-46e5-9fbd-d5bf3c0f3785">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLargeLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile="Resources/priomEula.rtf"
ShowVersion="yes"
logoFile="Resources/logoSide.png"
ThemeFile="Resources/ClassicTheme.xml"
LocalizationFile="Resources/ClassicTheme.wxl"/>
</BootstrapperApplicationRef>
<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]Priom Biswas" />
<Chain>
<MsiPackage Id="ClassLibraryMsi"
SourceFile="$(var.WixProjectForDemoClassLibrary.TargetDir)WixProjectForDemoClassLibrary.msi"
displayName="Demo Class Library"
Visible="yes">
<MsiProperty Name="APPLICATIONFOLDER" Value="[InstallFolder]"/>
</MsiPackage>
<MsiPackage Id="ConsoleAppMsi"
SourceFile="$(var.WixProjectForDemoConsoleApp.TargetDir)WixProjectForDemoConsoleApp.msi"
displayName="Demo Console App"
Visible="yes">
<MsiProperty Name="APPLICATIONFOLDER" Value="[InstallFolder]" />
</MsiPackage>
</Chain>
</Bundle>
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
<Window Width="493" Height="320" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
<Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="F0F0F0" >Segoe UI</Font>
<Font Id="1" Height="-24" Weight="500" Foreground="000000">Segoe UI</Font>
<Font Id="2" Height="-22" Weight="500" Foreground="666666" Background="F0F0F0">Segoe UI</Font>
<Font Id="3" Height="-12" Weight="500" Foreground="000000" Background="F0F0F0" >Segoe UI</Font>
<Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="F0F0F0" Underline="yes">Segoe UI</Font>
<Font Id="5" Height="-24" Weight="500" Foreground="000000" Background="E0E0E0">Segoe UI</Font>
<Font Id="6" Height="-9" Weight="500" Foreground="000000" Background="F0F0F0">Segoe UI</Font>
<Font Id="7" Height="-16" Weight="500" Foreground="666666" Background="F0F0F0">Segoe UI Bold</Font>
<Image X="0" Y="0" Width="130" Height="-45" ImageFile="logo.png" Visible="yes"/>
<Text X="130" Y="-45" Width="500" Height="2" FontId="5" Visible="yes"></Text>
<Page Name="Help">
<Text X="150" Y="30" Width="-11" Height="30" FontId="2" disablePrefix="yes">#(loc.HelpHeader)</Text>
<Text X="150" Y="71" Width="-20" Height="-50" FontId="6" disablePrefix="yes">#(loc.HelpText)</Text>
<Button Name="HelpCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.HelpCloseButton)</Button>
</Page>
<Page Name="Install">
<Text X="150" Y="15" Width="-11" Height="100" FontId="7" disablePrefix="yes">#(loc.WillInstall)</Text>
<Richedit Name="EulaRichedit" X="150" Y="68" Width="-11" Height="-70" TabStop="yes" FontId="0" HexStyle="0x800000" />
<CheckBox Name="EulaAcceptCheckBox" X="-11" Y="-49" Width="246" 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>
<Page Name="Options">
<Text X="141" Y="20" Width="-11" Height="30" FontId="2">#(loc.OptionsHeader)</Text>
<Text X="141" Y="61" Width="-11" Height="17" FontId="3">#(loc.OptionsLocationLabel)</Text>
<EditBox Name="FolderEditBox" X="141" Y="90" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
<Button Name="browseButton" X="-11" Y="90" Width="75" Height="23" TabStop="yes" FontId="3">#(loc.OptionsbrowseButton)</Button>
<Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.OptionsOkButton)</Button>
<Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.OptionsCancelButton)</Button>
</Page>
</Theme>
我在这里省略了主题 xml 文件中的一些代码以便更好 清晰度。
我想要实现的是在安装 UI 中显示两个 msi 包的名称,并选择他/她想要安装的 msi 用户,并在名称旁边使用两个单选按钮或复选框msi 软件包。这可以在不创建自定义 UI 的情况下实现吗?任何形式的帮助将不胜感激。
注意:这两个 msi 包都具有独立的功能,它们都不是彼此的从属。所以我猜特征树不会是一个选择。我正在使用 wix 3.11
解决方法
作为选项,您可以使用 WPF(例如)编写自己的引导程序,并通过 UI 完成。 Here's great step-by-step guide how to do it。并且您的案例似乎在“快速概念概述”部分。
优点:
- 出色的用户界面,可随心所欲。
- 访问引导程序中的所有进程(运行 MSI、订单、处理结果、日志等)
缺点:
- 时间 - 不幸的是,您需要一些时间来实现所有内容、设计您的 UI,当然还要测试它。