2014-11-17 3 views
3

공급 업체가 제공 한 제 3 자 MSI가 있습니다. 그러나 MSI는 혼자 서 있지 않으며 설치를 완료하려면 여러 지원 파일 (dll, config 파일, 장치 드라이버 ...)이 필요합니다. MSI가있는 디렉토리에 이러한 파일이 없으면 설치를 시도했으며 설치 중에 누락 된 파일에 대해 불만을 표시합니다. 나에게 이것은 설치 프로그램을 만드는 이상한 방법이라고 생각됩니다. 어쨌든 Burn을 사용하기 위해이 "설치"를 번들로 제공하고 싶습니다. 이전에 MSIPackage를 사용했지만 단일 파일에서 작동합니다. 이 파일 그룹을 어떻게 지정합니까? 필자는 제 3 자의 MSI와 추가 파일을 포함하는 새로운 MSI를 만들려고 유혹을 느낀다. 그러나 실제로 내가 원하는 바가 아닌 일부 팬텀 프로그램이 설치된다.WiX Burn 용 복수 지원 파일 번들

미리 도움을 주셔서 감사합니다. 솔루션와

편집 :이 문제의 열쇠 톰에

많은 감사합니다. 여기 호기심이있는 사람들을 위해 WiX 3.8에서이 문제를 해결하기 위해 사용했던 코드와 단계가 있습니다.

먼저 타사 설치 프로그램이 저장된 디렉토리를 확보하십시오. AppNameDir이 응용 프로그램의 설치 파일의 위치를 ​​참조하는 전처리 변수입니다

"%WIX%bin\heat.exe" dir "$(ProjectDir)..\ThirdParty\AppDirectory" -dr Dir_AppName -cg PAYGROUP_AppName -ag -sreg -scom -srd -var "var.AppNameDir" -t "$(ProjectDir)\ComponentToPayload.xsl" -out "$(ProjectDir)AppNamePayloadGroup.wxs" 

.

내 변형 파일은 Tom이 링크 한 파일과 약간 다르지만 그리 많지는 않습니다. 원래 열 파일에 구성 요소 그룹을 만든 다음 DirectoryRef가 아닌 나중에 PayloadGroup으로 사용했습니다.

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

그러면 I 구성 요소에 대한 단편을 만들고

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

그리고 마침내 무리 사용 MsiPackage 요소 내에 체인

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

해답을 제공해 주셔서 감사합니다. 를 xsl에 추가하면 더 깔끔한 결과를 얻을 수 있습니다. – Herman

답변

3

에서 그룹을 참조하는 페이로드 그룹을 언급 (또는 페이로드를 다른 위치에두고 PayloadGroupRef을 사용).

이중 압축이 시간과 공간에 비효율적 일 수 있으므로 MsiPackage가 폭발하기 시작 했으므로 부트 스트 래퍼의 압축이 좋아질 수 있습니다.

+0

큰 제안, 그것은 나에게 새로운 문을 열었습니다. 열이 실제로 페이로드 그룹을 생성하기위한 디렉토리를 수집 할 수 있는지 알고 있습니까? 나는 "- 생성 페이로드 그룹"스위치를 시도했지만 모두 나왔어 구성 요소입니다. –

+1

열은 출력에서 ​​XSL 변환을 수행합니다. 이 [응답] (http://stackoverflow.com/a/26812244/2226988)의 "FilesToPayloads.xsl"을 참조하십시오. –

+0

도움을 주셔서 감사합니다. 제안을 통합했으며 효과가있었습니다. 내 새 코드를 표시 할 원본 게시물을 편집했습니다. –

1

감사합니다. 다른 게시물 (특히 this one)의 도움으로 xslt도 Name 속성 (하위 폴더 포함)을 포함하고 빈 줄을 제거했습니다.

<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:strip-space elements="*"/> 

<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> 
    <xsl:attribute name="Name"> 
    <xsl:call-template name="string-replace-all"> 
     <xsl:with-param name="text" select="@Source"/> 
     <xsl:with-param name="replace" select="'$(var.SourceDir)\'"/> 
     <xsl:with-param name="by" select="''"/> 
    </xsl:call-template> 
    </xsl:attribute> 
</Payload> 
</xsl:template> 

<xsl:template name="string-replace-all"> 
<xsl:param name="text" /> 
<xsl:param name="replace" /> 
<xsl:param name="by" /> 
<xsl:choose> 
    <xsl:when test="contains($text, $replace)"> 
    <xsl:value-of select="substring-before($text,$replace)" /> 
    <xsl:value-of select="$by" /> 
    <xsl:call-template name="string-replace-all"> 
     <xsl:with-param name="text" 
     select="substring-after($text,$replace)" /> 
     <xsl:with-param name="replace" select="$replace" /> 
     <xsl:with-param name="by" select="$by" /> 
    </xsl:call-template> 
    </xsl:when> 
    <xsl:otherwise> 
    <xsl:value-of select="$text" /> 
    </xsl:otherwise> 
</xsl:choose> 
</xsl:template> 
</xsl:stylesheet> 

이 정보가 Wix 부트 스타터 빌드를 자동화하는 데 도움이되기를 바랍니다.

관련 문제