自定义 WiX Burn 引导程序用户界面?

发布于 2024-12-11 02:37:41 字数 504 浏览 0 评论 0原文

我主要使用 WiX 3.6 创建安装包,这样我就可以利用 Burn 引导功能。到目前为止,我已经将多个 MSI 软件包捆绑在一起,这些软件包将与内置引导程序应用程序 (WixStandardBootstrapperApplication.RtfLicense) 一起安装。

我读到 Burn 允许通过指定自定义 UX.dll 来替换默认引导程序应用程序,但我还没有找到任何描述自定义 ux.dll 的资源。 dll的构建(即它如何与Burn引擎集成,我使用什么技术,我应该实现什么接口等)。

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

因此,我确实有两个问题:

  1. 默认引导程序应用程序可自定义的程度如何?
  2. 是否有任何资源可以描述如何构建自定义 UX.dll

I'm creating an installation package with WiX 3.6 primarily so I can take advantage of the Burn bootstrapping features. So far I have several MSI packages bundled together that will be installed with the built-in bootstrapper application (WixStandardBootstrapperApplication.RtfLicense).

I have read that Burn allows the default bootstrapper application to be replaced by specifying a custom UX.dll, but I haven't yet been able to locate any resources that describes how the custom ux.dll is constructed (that is, how it integrates with the Burn engine, what technologies do I use, what interfaces should I implement, etc.).

My goal is to create a branded bootstrapper that can collect arbitrary information from a user and pass that information onto the various bundled MSI files, EXE files, etc.

So I have two questions really:

  1. To what degree is the default bootstrapper application customizable?
  2. Are there any resources available that describe how to construct a custom UX.dll?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

鲜肉鲜肉永远不皱 2024-12-18 02:37:41

要知道的关键是 WiX 二进制文件中有一个 BootstrapperCore.dll,它定义了一个 BootstrapperApplication 类,用于处理与 Burn 引擎的集成。我需要创建自己的派生类并重写“Run”方法来启动我的自定义 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>

配置文件包含:

<?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>

我还遵循了其他示例并将其附加

[assembly: BootstrapperApplication(typeof([name of class deriving from BootstrapperApplication]))]

AssemblyInfo.cs 文件中。

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

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

The key thing to know is that there is a BootstrapperCore.dll in the WiX binaries that defines a BootstrapperApplication class that handles the integration with the Burn engine. I needed to create my own derived class and override the 'Run' method to launch my custom UI.

It was also helpful to use the WixBA project that defines the UI for the WiX bootstrapper as a reference for using the BootstrapperApplication class (src\Setup\WixBA\WixBA.csproj).

The markup I used to reference my custom bootstrapper DLL file is:

<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>

The configuration file consists of:

<?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>

I also followed other examples and appended

[assembly: BootstrapperApplication(typeof([name of class deriving from BootstrapperApplication]))]

to the AssemblyInfo.cs file.

And lastly, Stack Overflow question Specify the INSTALLLOCATION of packages in WiX inside the Burn managed bootstrapper describes how to set and use Burn variables to help drive the installation.

Armed with this information I am now prepared to wreak havoc on the world with my very own custom Bootstrapper application!

花开半夏魅人心 2024-12-18 02:37:41

为了补充@Bill Campbell的答案,我在 在 .NET 中编写自定义 WiX Bootstrapper,它更深入地介绍了所涉及的各个部分,至少对于托管代码解决方案而言是如此。

To supplement @Bill Campbell's answer, I've written a series of blog posts on writing a custom WiX Bootstrapper in .NET which goes into more depth about the pieces involved, at least for a managed code solution.

梦太阳 2024-12-18 02:37:41

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

简而言之,您需要像这样声明变量(我将其放在 BootstrapperApplicationRef 之前),

<WixVariable Id="PreqbaThemeXml" Value="tt.thm" />
<WixVariable Id="PreqbaThemeWxl" Value="tt.wxl" />

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

<Payload SourceFile="tt.wxl"/>
<Payload SourceFile="tt.wxl"/>
<Payload SourceFile="cat.png"/>

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

Not precisely answer to this question, but if you want to customize appearance of ManagedBootstrapperApplicationHost, then this is what you need to do.

To keep short, you need to declare your variables like this (I put it before BootstrapperApplicationRef)

<WixVariable Id="PreqbaThemeXml" Value="tt.thm" />
<WixVariable Id="PreqbaThemeWxl" Value="tt.wxl" />

assuming tt.thm is your theme file, and tt.wxl is your translation file.
Note those files, as well as all files they reference must be included to BootstrapperApplicationRef as Payoload, like

<Payload SourceFile="tt.wxl"/>
<Payload SourceFile="tt.wxl"/>
<Payload SourceFile="cat.png"/>

As an example of layout you can use mbapreq.thm, found under WiX sources.

还在原地等你 2024-12-18 02:37:41

除了此处列出的其他资源之外,Burn 的自定义引导程序应用程序的一个很好的简单示例是 自定义 WiX 托管引导程序应用程序

我发现在深入研究其他更彻底的示例(例如 WiX 源代码中的 WixBA 项目)之前,这是一个很好的起点。

In addition to the other resources listed here, a good bare-bones example of a custom bootstrapper application for Burn is Custom WiX Managed Bootstrapper Application.

I found that this is a good place to start with before digging deeper into other more thorough examples like the WixBA project in the WiX sources.

慢慢从新开始 2024-12-18 02:37:41

设置此功能时我遗漏的一个细节是我必须包含对 WixBalExtension.dll 的引用。这是因为 ManagedBootstrapperApplicationHost 是在该 DLL 中定义的,并在捆绑包中使用,如下所示:

<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload Name="BootstrapperCore.config"
               SourceFile="MyBA.BootstrapperCore.config" />
      <Payload SourceFile="MyBA.dll"/>
</BootstrapperApplicationRef>

One detail I was missing when setting this up was that I had to include a reference to WixBalExtension.dll. That's because the ManagedBootstrapperApplicationHost is defined in that DLL and used in the bundle like this:

<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload Name="BootstrapperCore.config"
               SourceFile="MyBA.BootstrapperCore.config" />
      <Payload SourceFile="MyBA.dll"/>
</BootstrapperApplicationRef>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文