Can I optionally Include specific file extensions with Wix Heat using transforms?

dingdangdowney

Is it possible to include only certain file Extensions when using an xslt file to transform heat harvesting components using wix? I know I can exclude file extensions with the following:

<xsl:key name="exe-search" match="wix:Component[contains(wix:File/@Source, '.pdb')]" use="@Id" /> <!--.pdb-->

but is it possible to include several file types and exclude everything else (for example: .exe, .dll, .xml)?

Thank you!

Tom Blodget

Sure. Inside the condition, you can use full expressions, like:

   contains(wix:File/@Source, '.pdb') 
or contains(wix:File/@Source, '.exe') 
or contains(wix:File/@Source, '.dll') 
or contains(wix:File/@Source, '.xml')

If it's just an handful, that should be maintainable. To aid readability, you can put newlines inside the match attribute value (or any attribute in general).


I would use it like this. Notice the poor man's ends-with trick.

The template matches unwanted Components and replaces them with nothing.

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

    <xsl:template match="wi:Component[not(
        contains(concat(wi:File/@Source,'|'), '.exe|') or
        contains(concat(wi:File/@Source,'|'), '.config|'))]">
     </xsl:template>


     <xsl:template match="node()|@*">
       <xsl:copy>
       <xsl:apply-templates select="@*"/>
       <xsl:apply-templates/>
       </xsl:copy>
     </xsl:template>
 </xsl:stylesheet>

Here's a heat command that it works with:

heat dir "%wix%\bin" -cg CompGroup -ag -t byext.xsl -o test.wxs

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

WiX Heat预构建错误

来自分类Dev

如何在Wix中引用heat.exe生成的wxs文件中的File元素

来自分类Dev

Wix \ heat.exe奇怪的输出

来自分类Dev

Wix / Heat:访问.wixproj文件中的<ProjectReference>

来自分类Dev

WIX Heat错误的“ registryvalue”“ codebase”值

来自分类Dev

Wix / Heat:访问.wixproj文件中的<ProjectReference>

来自分类Dev

WiX:在卸载或升级时保持文件被Heat收集

来自分类Dev

WIX Heat预构建变量名称以供目录收集

来自分类Dev

wix heat使用xsl文件删除名称空间

来自分类Dev

WiX Heat工具生成的参考子目录

来自分类Dev

How can I change the text in the Wix installer dialog?

来自分类Dev

How can I get around this annoying WiX issue?

来自分类Dev

WiX中File元素的Source属性中的using属性

来自分类Dev

Using Gradle, how can I ensure that a file exists at a certain location?

来自分类Dev

How can I work with a .csv file using Java Spring Resttample?

来自分类Dev

how to include specific js file in ember.js

来自分类Dev

How can I use sed to make thousands of substitutions in a file using a reference file?

来自分类Dev

PE/COFF file extensions

来自分类Dev

WiX Heat.exe生成导致错误ICE57的wxs文件

来自分类Dev

WiX Heat.exe Win64组件-Win64 =“ yes”

来自分类Dev

Wix Heat-使用XSLT用已知的字符串替换自动生成的GUID

来自分类Dev

WiX Heat:预构建事件在构建服务器上触发得太早

来自分类Dev

WiX Heat.exe生成导致错误ICE57的wxs文件

来自分类Dev

Wix heat.exe 命令行开关“-directoryid”在做什么?

来自分类Dev

Wix::heat,是否可以在收获时在组件元素下添加子元素?

来自分类Dev

How can I dynamically include external files / user control?

来自分类Dev

How can I read float data from a binary file using R

来自分类Dev

我可以选择使用转换将特定的文件扩展名包含在Wix Heat中吗?

来自分类Dev

In my haml file, I want to include a link within a string that is coming from a yml file

Related 相关文章

  1. 1

    WiX Heat预构建错误

  2. 2

    如何在Wix中引用heat.exe生成的wxs文件中的File元素

  3. 3

    Wix \ heat.exe奇怪的输出

  4. 4

    Wix / Heat:访问.wixproj文件中的<ProjectReference>

  5. 5

    WIX Heat错误的“ registryvalue”“ codebase”值

  6. 6

    Wix / Heat:访问.wixproj文件中的<ProjectReference>

  7. 7

    WiX:在卸载或升级时保持文件被Heat收集

  8. 8

    WIX Heat预构建变量名称以供目录收集

  9. 9

    wix heat使用xsl文件删除名称空间

  10. 10

    WiX Heat工具生成的参考子目录

  11. 11

    How can I change the text in the Wix installer dialog?

  12. 12

    How can I get around this annoying WiX issue?

  13. 13

    WiX中File元素的Source属性中的using属性

  14. 14

    Using Gradle, how can I ensure that a file exists at a certain location?

  15. 15

    How can I work with a .csv file using Java Spring Resttample?

  16. 16

    how to include specific js file in ember.js

  17. 17

    How can I use sed to make thousands of substitutions in a file using a reference file?

  18. 18

    PE/COFF file extensions

  19. 19

    WiX Heat.exe生成导致错误ICE57的wxs文件

  20. 20

    WiX Heat.exe Win64组件-Win64 =“ yes”

  21. 21

    Wix Heat-使用XSLT用已知的字符串替换自动生成的GUID

  22. 22

    WiX Heat:预构建事件在构建服务器上触发得太早

  23. 23

    WiX Heat.exe生成导致错误ICE57的wxs文件

  24. 24

    Wix heat.exe 命令行开关“-directoryid”在做什么?

  25. 25

    Wix::heat,是否可以在收获时在组件元素下添加子元素?

  26. 26

    How can I dynamically include external files / user control?

  27. 27

    How can I read float data from a binary file using R

  28. 28

    我可以选择使用转换将特定的文件扩展名包含在Wix Heat中吗?

  29. 29

    In my haml file, I want to include a link within a string that is coming from a yml file

热门标签

归档