¿Cómo establecer sistemáticamente el atributo "Readonly" a los archivos cosechados con calor?

StackOverflow https://stackoverflow.com/questions/8840675

  •  27-10-2019
  •  | 
  •  

Pregunta

Estoy cosechando un directorio usando Heat, sin embargo, no pude encontrar una opción para establecer los atributos "Readonly" para todos los archivos Harvest usando Heat.

¿Alguien ha sabido alguna forma de hacerlo en calor?

¿Fue útil?

Solución

Aplique una transformación XSLT al fragmento generado por el calor y agregue ReadOnly="yes" a cada File elemento. Este XSLT hace la cosa:

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

    <xsl:template match="wix:File">
        <xsl:copy>
            <xsl:apply-templates select="@*" />
            <xsl:attribute name="ReadOnly">
                <xsl:text>yes</xsl:text>
            </xsl:attribute>
            <xsl:apply-templates select="*" />
        </xsl:copy>
    </xsl:template>

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

    <xsl:template match="@* | text()">
        <xsl:copy />
    </xsl:template>

    <xsl:template match="/">
        <xsl:apply-templates />
    </xsl:template>

</xsl:stylesheet>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top