捆绑 WiX Burn 的多个支持文件 [英] Bundle multiple support files for WiX Burn

查看:14
本文介绍了捆绑 WiX Burn 的多个支持文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由供应商提供给我的第三方 MSI.然而 MSI 并不独立,它需要多个支持文件(dll、配置文件、设备驱动程序...)来完成安装.我尝试在 MSI 目录中不存在这些文件的情况下进行安装,它抱怨安装过程中缺少文件.在我看来,这是构建安装程序的一种奇怪方式.无论如何,我想捆绑这个安装"以供 Burn 使用.我以前使用过 MSIPackage,但它适用于单个文件.我将如何指定这组文件?我很想制作一个新的 MSI,其中包括来自第三方的 MSI 以及其他文件,但最终我安装了一些幻像程序,这真的不是我想要的.

I have a third party MSI that has been supplied to me by a vendor. However the MSI does not stand alone, it requires multiple support files (dll's, config files, device drivers ...) to complete an installation. I've tried to install without these files present in the directory with the MSI and it complains about the missing files during installation. Seems to me this is an odd way to build an installer. Anyway, I'd like to bundle this "installation" to be consumed by Burn. I've used MSIPackage before, but that works for a single file. How would I specify this group of files? I'm tempted to make an new MSI that includes the MSI from the third party plus the additional files, but then I end up with the some phantom program installed which is really not what I want.

提前感谢您的帮助.

使用解决方案编辑:

非常感谢 Tom 提供了解决此问题的关键.对于那些好奇的人,这里是我在 WiX 3.8 中用来解决这个问题的代码和步骤.

Many Thanks to Tom for the keys to this problem. For those that are curious here is the code and steps I used to solve this problem in WiX 3.8.

首先获取存储第三方安装程序的目录.

First harvest the directory where the third party installer was stored.

"%WIX%binheat.exe" dir "$(ProjectDir)..ThirdPartyAppDirectory" -dr Dir_AppName -cg PAYGROUP_AppName -ag -sreg -scom -srd -var "var.AppNameDir" -t "$(ProjectDir)ComponentToPayload.xsl" -out "$(ProjectDir)AppNamePayloadGroup.wxs"

其中 AppNameDir 是一个预处理器变量,引用应用程序安装文件的位置.

Where AppNameDir is a preprocessor variable referencing the location of the app installation files.

我的转换文件与 Tom 链接的文件略有不同,但差别不大.我在原始热文件中创建了一个组件组,然后将其用作我的 PayloadGroup,而不是 DirectoryRef.

My transform file was a little different from the one linked to by Tom, but not much. I created a component group in my orginal heat file and then used that as my PayloadGroup later rather than the DirectoryRef.

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
  xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <xsl:template match="/">
    <Wix>
      <Fragment>
        <xsl:apply-templates select="*" />
      </Fragment>
    </Wix>
  </xsl:template>

  <xsl:template match="//wix:ComponentGroup">
    <PayloadGroup>
      <xsl:attribute name="Id">
        <xsl:value-of select="@Id"/>
      </xsl:attribute>
      <xsl:apply-templates select="*" />
    </PayloadGroup>
  </xsl:template>

  <xsl:template match="//wix:File">
    <Payload>
      <xsl:attribute name="SourceFile">
        <xsl:value-of select="@Source"/>
      </xsl:attribute>
    </Payload>
  </xsl:template>

</xsl:stylesheet>

然后我为组件创建了一个片段并引用了 Payload 组

Then I created a fragment for the component and referenced the Payload group

  <Fragment>
    <PackageGroup Id="PCKGRP_AppName">
      <MsiPackage
        SourceFile="$(var.AppNameDir)app.msi">
        <MsiProperty Name="PropertyName1" ="Value1"/>
        <MsiProperty Name="PropertyName2" ="Value2"/>
        <MsiProperty Name="PropertyName3" ="Value3"/>
        <PayloadGroupRef Id="PAYGROUP_AppName"/>
      </MsiPackage>
    </PackageGroup>
  </Fragment>

然后最后引用链中的组

    <Chain>
...
      <PackageGroupRef Id="PCKGRP_AppName"/>
...
    </Chain>   

推荐答案

在 MsiPackage 元素中使用一堆 Payload 元素(或将有效负载放在其他地方并使用 PayloadGroupRef).

Inside the MsiPackage element use a bunch of Payload elements (or put the payloads elsewhere and use a PayloadGroupRef).

作为补偿,您的引导程序可能会获得更好的压缩,因为 MsiPackage 开始爆炸,因为双重压缩在时间和空间上可能效率低下.

In compensation, your bootstrapper might get better compression since the MsiPackage is starting out exploded because double compression can be inefficient with time and space.

这篇关于捆绑 WiX Burn 的多个支持文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆