Using WiX to package an installer with many files

荒凉一梦 提交于 2020-01-23 02:59:06

问题


I have a WiX 3 project that has hundreds of files, and I can't seem to figure out how to include them all using a wildcard. I have tried this:

heat.exe" dir ".\!Build" -gg -ke -template:fragment -out "Files.wxs"

This produces a fragment .wxs file, but I'm not sure what to do with it. Any help would be much appreciated.


回答1:


Try this command

heat dir "Your_Directory" -gg -ke -template:Product -out "Files.wxs"

It will create this structure in the generated wxs file {Files.wxs}:

<Fragment>
    <DirectoryRef Id="Files">
        <Component Id="Test.ico" Guid="{YOUR_GUID}">
            <File Id="Test.ico" Name="Test.ico" KeyPath="yes" Source="..[path to file]\Test.ico" />
        </Component>
    </DirectoryRef>
</Fragment>

You should get one for each file, that was in the directory that you ran heat against. Once that is done, you just have to add the wxs file to your project, make sure you have the directory that the directoryref points to is created.



来源:https://stackoverflow.com/questions/1295539/using-wix-to-package-an-installer-with-many-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!