2016-08-29 2 views
0

Feature이 있는데, ComponentGroup을 참조합니다. 그 ComponentGroup은 다른 파일의 Fragment에 정의되어 있으며 Component의 수를 포함합니다.WiX ComponentGroup 조건

이 프로젝트는 여러 버전의 제품에서 공유되므로 Product.wxs 파일의 한 버전을 유지 관리하고 싶습니다. 코드베이스는 제품 버전간에 공통적으로 사용됩니다.

ComponentGroup에 조건을 설정하여 설치 프로그램에 포함할지 여부를 결정할 수 있습니까?

답변

2

예, 가능합니다. 당신은 빌드시에 IncludeAnotherGroup 변수의 값을 제공 할 수

<Feature Id="MyFeature" Title="Some title" Level="100"> 
    <ComponentGroupRef Id="ComponentGroup1"/> 
    <ComponentGroupRef Id="ComponentGroup2"/> 
    <?if $(var.IncludeAnotherGroup) = true ?> 
    <ComponentGroupRef Id="AnotherGroup"/> 
    <?endif ?> 
</Feature> 

, 예를 들면 : 아래의 코드는 완벽하게 유효한 윅스 코드 이 코드 (NAnt 코드) :

<candle ...> 
    <defines> 
    <define name="IncludeAnotherGroup" value="true" /> 
    </defines> 
    <sources basedir="${paths.wxs}"> 
    <include name="**.wxs"/> 
    </sources> 
</candle> 
+0

정확히 내가 필요한 것입니다. Visual Studio 솔루션을 사용하여 명령 줄에서 빌드를 호출합니다. 이전에 config.wxi의 버전 문자열 값을 수정하여 설치 프로그램을 작성하기 전에 (정확한 코드베이스를 작성하기 전에). msbuild 명령 줄에서 변수를 설정할 수 있습니까? – Jon

+0

@ 존, WiB와 함께 MSBuild를 사용하는 공식 문서가 많이 있습니다. http://wixtoolset.org/documentation/manual/v3/msbuild/ –