collect-transform.xsl.in 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
  5. <xsl:output method="xml" indent="yes" />
  6. <!-- Copy all attributes and elements to the output. -->
  7. <xsl:template match="@*|*">
  8. <xsl:copy>
  9. <xsl:apply-templates select="@*" />
  10. <xsl:apply-templates select="*" />
  11. </xsl:copy>
  12. </xsl:template>
  13. <!-- Identify MainExecutable -->
  14. <xsl:key name="exe-search" match="wix:File[contains(@Source, '@APPLICATION_EXECUTABLE@.exe')]" use="@Id" />
  15. <xsl:template match="wix:File[key('exe-search', @Id)]">
  16. <xsl:copy>
  17. <xsl:apply-templates select="@*" />
  18. <xsl:attribute name="Id">
  19. <xsl:text>MainExecutable</xsl:text>
  20. </xsl:attribute>
  21. <xsl:apply-templates/>
  22. </xsl:copy>
  23. </xsl:template>
  24. <!-- Exclude Shell Extensions -->
  25. <xsl:key name="shellext-search" match="wix:Component[contains(wix:File/@Source, 'NCContextMenu.dll') or contains(wix:File/@Source, 'NCOverlays.dll')]" use="@Id" />
  26. <xsl:template match="wix:Component[key('shellext-search', @Id)]" />
  27. <xsl:template match="wix:ComponentRef[key('shellext-search', @Id)]" />
  28. <!-- Exclude VC Redist -->
  29. <xsl:key name="vc-redist-32-search" match="wix:Component[contains(wix:File/@Source, 'vc_redist.x86.exe')]" use="@Id" />
  30. <xsl:template match="wix:Component[key('vc-redist-32-search', @Id)]" />
  31. <xsl:template match="wix:ComponentRef[key('vc-redist-32-search', @Id)]" />
  32. <xsl:key name="vc-redist-64-search" match="wix:Component[contains(wix:File/@Source, 'vc_redist.x64.exe')]" use="@Id" />
  33. <xsl:template match="wix:Component[key('vc-redist-64-search', @Id)]" />
  34. <xsl:template match="wix:ComponentRef[key('vc-redist-64-search', @Id)]" />
  35. </xsl:stylesheet>