自定义WiX Burn bootstrapper用户界面?

Bil*_*ell 45 wix burn wix3.6

我正在创建一个主要使用WiX 3.6的安装包,因此我可以利用Burn自举功能.到目前为止,我有几个捆绑在一起的MSI软件包,它们将与内置的bootstrapper应用程序一起安装(WixStandardBootstrapperApplication.RtfLicense).

我已经读过Burn允许通过指定自定义来替换默认的bootstrapper应用程序UX.dll,但是我还没有找到描述自定义ux.dll构造方式的任何资源(也就是说,它如何与Burn引擎集成,什么我使用的技术,应该实现哪些接口等等.

我的目标是创建一个品牌引导程序,它可以从用户收集任意信息,并将该信息传递到各种捆绑的MSI文件,EXE文件等.

所以我真的有两个问题:

  1. 默认的bootstrapper应用程序在多大程度上可以自定义?
  2. 是否有可用的资源描述如何构建自定义UX.dll

Bil*_*ell 41

要知道的关键是WiX二进制文件中有一个BootstrapperCore.dll,它定义了一个BootstrapperApplication类,用于处理与Burn引擎的集成.我需要创建自己的派生类并覆盖"运行"方法以启动我的自定义UI.

使用定义WiX引导程序UI的WixBA项目作为使用BootstrapperApplication类(src\Setup\WixBA\WixBA.csproj)的参考也很有帮助.

我用来引用我的自定义引导程序DLL文件的标记是:

<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
  <Payload SourceFile="$(var.InstallSourceResources)Bootstrapper\FusionInstallUX.dll"/>
  <Payload Id="FusionInstallUX.config"
           SourceFile="$(var.InstallSourceResources)Bootstrapper\FusionInstallUX.BootstrapperCore.config"
           Name="BootstrapperCore.config" Compressed="yes"/>
</BootstrapperApplicationRef>
Run Code Online (Sandbox Code Playgroud)

配置文件包括:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup
            name="wix.bootstrapper"
            type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">

            <section
                name="host"
                type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
        </sectionGroup>
    </configSections>

    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" />
    </startup>

    <wix.bootstrapper>
        <host assemblyName="FusionInstallUX">
            <supportedFramework version="v4\Full" />
            <supportedFramework version="v4\Client" />
        </host>
    </wix.bootstrapper>
</configuration>
Run Code Online (Sandbox Code Playgroud)

我还跟着其他例子并附上了

[assembly: BootstrapperApplication(typeof([name of class deriving from BootstrapperApplication]))]
Run Code Online (Sandbox Code Playgroud)

AssemblyInfo.cs文件.

最后,Stack Overflow问题在Burn托管引导程序内指定WiX中的软件包的INSTALLLOCATION描述如何设置和使用Burn变量来帮助驱动安装.

有了这些信息,我现在准备用我自己的自定义Bootstrapper应用程序对世界造成严重破坏!


Joh*_*ght 24

为了补充@Bill Campbell的答案,我写了一系列关于在.NET中编写自定义WiX Bootstrapper的博客文章,其中更深入地介绍了所涉及的部分,至少对于托管代码解决方案而言.


Dav*_*sen 6

除了此处列出的其他资源之外,Burn的定义引导程序应用程序的一个很好的例子是Custom WiX Managed Bootstrapper Application.

我发现这是一个很好的开始,然后深入研究其他更全面的例子,比如WiX源中的WixBA项目.


iro*_*nic 5

不能准确回答这个问题,但是如果您想自定义 ManagedBootstrapperApplicationHost 的外观,那么就是您需要做的。

简而言之,你需要像这样声明你的变量(我把它放在 BootstrapperApplicationRef 之前)

<WixVariable Id="PreqbaThemeXml" Value="tt.thm" />
<WixVariable Id="PreqbaThemeWxl" Value="tt.wxl" />
Run Code Online (Sandbox Code Playgroud)

假设tt.thm是您的主题文件,而tt.wxl是您的翻译文件。请注意,这些文件以及它们引用的所有文件都必须作为Payoload包含在BootstrapperApplicationRef中,例如

<Payload SourceFile="tt.wxl"/>
<Payload SourceFile="tt.wxl"/>
<Payload SourceFile="cat.png"/>
Run Code Online (Sandbox Code Playgroud)

作为布局示例,您可以使用mbapreq.thm,在 WiX 源下找到。