당신이 사용하고자하는 것과 같은 소리는 디렉토리 (또는 개별 파일)를 "수확"하고 프로젝트에서 사용할 수있는 WiX 조각 파일을 만드는 데 사용되는 WiX 도구 heat
입니다.
예를 들어, 수확하려는 디렉토리가 있고 하위 디렉토리가 포함될 수 있지만 많은 파일이 있으며 원하는 모든 것을 원하면 열이 자동으로 처리됩니다. 를 지정하지 않고이 디렉토리를 수확하기 위해 열을 사용하는 경우
Somedir
|
|---A file.txt
|---An init file.ini
|---another file.txt
|---subfolder
|
|---a subfolder file.txt
이 도구는 프로젝트의 구성 요소 참고 자료로 사용할 수있는 당신을 위해 조각 파일을 생성합니다
이 사소한 구조를 고려 한 번에 하나씩 파일을 보거나 해결 방법 솔루션을 사용하십시오.
예를 들어, 다음 열 명령은이 디렉토리를 처리 할
heat dir somedir -o MyHarvestedStuff.wxs -scom -frag -srd -sreg -gg -cg MyComponentGroupId -dr BIN_DIR_REF
(이 예에서 한 단계 위로부터) :
는 결과 XML (이 보이는
dir = harvest a directory
somedir = directory you want to harvest
-o MyHarvestedStuff.wxs = the output fragment file
-scom -sfrag -srd -sreg = Suppress COM elements, fragments, root directory as element, registry harvesting (these options will create a grouping that most applications can use)
-gg = generate GUID's now (this will put the GUID's into your output file, rather than using a wildcard "*". The advantage here is you can use non-standard TARGETDIR, which would not qualify for autogenerated GUID's)
-cg MyComponentGroupId = component group. this is what you will use in your feature set to include these files
-dr BIN_DIR_REF = this is the directory reference for which to place the files in your final package.
이 실행 한 실제 GUID를 게시하지 않으려면 -gg를 사용하지 마십시오.)
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="BIN_DIR_REF">
<Directory Id="dirF065D7446868E03DB0B296EBADA4E4A1" Name="subfolder" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="MyComponentGroupId">
<Component Id="cmp739547000B47E975B0452D876AF7810B" Directory="BIN_DIR_REF" Guid="PUT-GUID-HERE">
<File Id="fil09B311A6D1EABD9E94DFA5C83F59C548" KeyPath="yes" Source="SourceDir\A file.txt" />
</Component>
<Component Id="cmp84C8400F892D39B05EE3021CCEEAA14F" Directory="BIN_DIR_REF" Guid="PUT-GUID-HERE">
<File Id="fil11A22646343997D26AC54171A62DFF4C" KeyPath="yes" Source="SourceDir\an init file.ini" />
</Component>
<Component Id="cmpFA266FC6F3269CB5D9E42C38FC995117" Directory="BIN_DIR_REF" Guid="PUT-GUID-HERE">
<File Id="filA545B6E4B63B8211E982917FC78F6EB4" KeyPath="yes" Source="SourceDir\another file.txt" />
</Component>
<Component Id="cmp2EC5C1618A59F47B7BDE800EB9AA8688" Directory="dirF065D7446868E03DB0B296EBADA4E4A1" Guid="PUT-GUID-HERE">
<File Id="filB0CD0B02385137DC806112E293083459" KeyPath="yes" Source="SourceDir\subfolder\a subfolder file.txt" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
프로젝트 파일에서
<Directory Id="BIN_DIR_REF" Name="bin">
<!-- anything else you might put here...-->
</Directory>
그리고 당신의 기능 그룹의
:
<Feature Id="Complete" Level="1">
...
<ComponentGroupRef Id="MyComponentGroupId" />
...
</Feature>
함께 묶기 ... candle
에
- 공급 새로운 조각 파일 루트에서
<Directory>
요소를 이런 식으로 뭔가를 다른 파일들과 함께
candle
이 생성하는 .wixobj 파일을에 제공하십시오. light ... -b "path to my directory that I harvested" ...
대답의 길이가 저지하지 마십시오
는 윅스 처리기 변수 또는 -b
옵션 light
에
예와 새 조각 파일의 SourceDir
참조를 해결 당신은이 솔루션을 탐색하는 것으로부터 꽤 잘 작동하며 매우 간단합니다. 이제 해당 디렉토리에서 아무 것도 제외 시키려면 전체 다른 이야기 ...
http://stackoverflow.com/a/16061215/815938 – kennyzx
가능한 복제본 [wix에서 폴더를 복사하는 방법] (http://stackoverflow.com/questions/16061092/how-do-copy-a-folder-in-wix) –
@ RyanJ의 답변 (http://stackoverflow.com/a/26558025/5229157)으로 표시되어야합니다. 정답. 매우 도움이됩니다. –