I have created this xsl for dynamically create .WXS output.But i am facing one issue like as per the below xsl it creates component group for each folder.I don't want to create component group for each folder and i need to have only one component group and add all the components into this group.
I have one component gruop "HelpFiles_Group" as mentioned in the below output and it generates from heat.exe.I have added "extjs","css" folders manually within the same "HelpFiles_Group" group but i am expecting this should be part of XSL..
以下の xsl を使用している間、「extjs」、「css」フォルダーに異なるコンポーネント グループを作成しています。すべてのコンポーネントを同じコンポーネント グループに追加するにはどうすればよいでしょうか? 以下の XSL で必要な変更は何ですか?
私のXSL、
<xsl:stylesheet version="2.0"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="wix">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="wix:Wix">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<xsl:for-each select="wix:Fragment/wix:DirectoryRef/wix:Directory">
<wix:Fragment>
<wix:ComponentGroup Id="{@Name}">
<xsl:if test="count(descendant::wix:Component) = 0">
<wix:Component Id="{@Id}" Directory="{@Id}" Guid="">
<wix:RemoveFolder Id="{@Name}" On="uninstall" />
<!--<wix:RegistryValue Root="HKCU" Key="SOFTWARE\IOM\NgSSimulation" Type="string" Value="NextGen" KeyPath="yes" />-->
</wix:Component>
</xsl:if>
</wix:ComponentGroup>
</wix:Fragment>
</xsl:for-each>
</xsl:copy>
</xsl:template>
<xsl:template match="wix:Component">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
<RegistryValue Root="HKCU" Key="SOFTWARE\IOM\NgSSimulation" Type="string" Value="SimCentral" KeyPath="yes" xmlns="http://schemas.microsoft.com/wix/2006/wi"/>
</xsl:copy>
</xsl:template>
<xsl:template match="wix:File">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:attribute name="KeyPath">
<xsl:text>no</xsl:text>
</xsl:attribute>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
出力 .WXS が必要です。
<Fragment>
<DirectoryRef Id="Simulation_Help">
<Directory Id="extjs" Name="extjs" />
<Directory Id="images_1" Name="images" />
<Directory Id="uilocale" Name="uilocale" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="HelpFiles_Group">
<Component Id="extjs" Guid="{8FB704ED-5A08-42DF-A593-8F04AD8EAB64}" Directory="extjs">
<RemoveFolder Id="SimSciHelp_extjs" On ="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\IOM\SimCentral" Type="string" Value="SimCentral" KeyPath="yes" />
</Component>
<Component Id="css" Guid="{A5066974-3279-4C45-85EA-F3A7F55343C4}" Directory="css">
<RemoveFolder Id="css" On ="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\IOM\SimCentral" Type="string" Value="SimCentral" KeyPath="yes" />
</Component>
<Component Id="default" Guid="{BF114032-02E5-49B1-A8FD-F927843A5E7A}" Directory="default">
<RemoveFolder Id="default" On ="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\IOM\SimCentral" Type="string" Value="SimCentral" KeyPath="yes" />
</Component>
<Component Id="button" Guid="{42BE8034-622B-4C76-8FA1-78DDD151037C}" Directory="button">
<RemoveFolder Id="button" On ="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\IOM\SimCentral" Type="string" Value="SimCentral" KeyPath="yes" />
</Component>
新しい XSL に従って出力
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<wix:Fragment xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:ComponentGroup Id="Simulation_Help">
<wix:Component Id="extjs" Directory="extjs" Guid="">
<wix:RemoveFolder Id="extjs" On="uninstall" />
</wix:Component>
<wix:Component Id="images_1" Directory="images_1" Guid="">
<wix:RemoveFolder Id="images" On="uninstall" />
</wix:Component>
<wix:Component Id="uilocale" Directory="uilocale" Guid="">
<wix:RemoveFolder Id="uilocale" On="uninstall" />
</wix:Component>
</wix:ComponentGroup>
</wix:Fragment>
<wix:Fragment xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:ComponentGroup Id="uilocale" />
</wix:Fragment>
<wix:Fragment xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:ComponentGroup Id="images_1" />
</wix:Fragment>
<wix:Fragment xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:ComponentGroup Id="tree" />
</wix:Fragment>
<wix:Fragment xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:ComponentGroup Id="toolbar" />