小编Ili*_*irB的帖子

使用XSLT转换Heat生成的.wxs(添加RegistryValue并编辑一些值)

这是我想要的输出:

<Component Id="C_SOMEFILE" Guid="some-guid-here">
    <File Id="File_SOMEFILE" Source="$(var.Source)\SOMEFILE" KeyPath="no" />
    <RegistryValue Root="HKCU" Key="Software\Product" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
Run Code Online (Sandbox Code Playgroud)

这是我的XSLT文件:

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

<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />

<xsl:strip-space elements="*"/>

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

<!--Set KeyPath to NO-->
<xsl:template match='wix:File[@Id]'>
    <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:attribute name="KeyPath">
            <xsl:text>no</xsl:text>
        </xsl:attribute>
    </xsl:copy>
</xsl:template>

<xsl:template match="wix:Component/wix:File">
    <xsl:copy-of select="." />
    <RegistryValue Root="HKCU" Key="Software\Product" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</xsl:template>

<!--Give Compoentent ID prefix C_-->
<xsl:template match="wix:Component/@Id">
    <xsl:attribute name="{name()}">
        <xsl:value-of select="concat('C_', …
Run Code Online (Sandbox Code Playgroud)

xml xslt wix heat

5
推荐指数
1
解决办法
3006
查看次数

收集用于 PerUser 安装程序的文件

我有一个需要明确成为 PerUser msi 的安装程序。当前的问题是,使用 Heat 收集文件并没有提供一种生成完全符合 PerUser 包的组件的方法。尤其ICE64 "The directory dir7956CF617C38D877C93B5A7D33313596 is in the user profile but is not listed in the RemoveFile table.

现在只要我知道结构就不是问题,因为我可以创建一个包含所有目录的组件并将其包含在功能中。但是,如果结构发生变化,那么找出所有目录并手动添加它们是一项手动工作。这消除了其他开发人员自由添加/删除文件的灵活性。

对于那些感兴趣的人来说,我使用的 heat 命令是: heat.exe dir "SourceDir" -dr INSTALLDIR -cg CG_Binaries -nologo -gg -g1 -sfrag -srd -svb6 -scom -sreg -var "var.Binaries" -out "Binaries.wxs"' />

这是 heat.exe 未经任何转换生成的原始 XML:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="INSTALLDIR">
            <Directory Id="dir7956CF617C38D877C93B5A7D33313596" Name="Folder1">
                <Component Id="cmp1CBAE345A14FB4F0343E1FC307F5EE1D" Guid="CBB5AF6A-D0A2-464D-BFAA-49F9C102A4F4">
                    <File Id="filB5C5E94E5D59CC7DB489F6823F341316" KeyPath="yes" Source="$(var.Binaries)\Folder1\NewTextFile0.txt" />
                </Component>
            </Directory>
            <Directory Id="dir2BA1778353CDCC6DE102110034297AC9" Name="Folder2">
                <Component Id="cmp55726990D3629FC63F840780B5BC7729" Guid="49CAB541-CEB5-423B-89E2-A42D51AD9E7E"> …
Run Code Online (Sandbox Code Playgroud)

xml xslt wix xslt-1.0

5
推荐指数
1
解决办法
418
查看次数

超时后中止Jenkins管道(工作流)构建

每当构建因某个地方而陷入故障时,超时就会开始,但是该构建不会被中止,并且它将一直运行直到您取消该构建,然后进入控制台并按链接 Click here to forcibly terminate running steps

这是我正在尝试但无法正常工作的示例代码:

stage concurrency: 1, name: 'Build'
def buildSteps = [:]
    buildSteps['Server'] = {
        timeout(1) {
            node('build') {
                timestamps {
                     bat "waitfor nothing /t 120 >nul"
            }
        }
    }   
}

parallel buildSteps
Run Code Online (Sandbox Code Playgroud)

这是日志

[Pipeline] stage (Build)
Entering stage Build
Proceeding
[Pipeline] parallel
[Pipeline] [Server] { (Branch: Server)
[Pipeline] [Server] timeout
[Pipeline] [Server] {
[Pipeline] [Server] node
[Server] Running on CI106 in C:\Jws\workspace\jftimeout
[Pipeline] [Server] {
[Pipeline] [Server] timestamps
[Pipeline] [Server] {
[Pipeline] [Server] …
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-pipeline

5
推荐指数
1
解决办法
5291
查看次数

标签 统计

wix ×2

xml ×2

xslt ×2

heat ×1

jenkins ×1

jenkins-pipeline ×1

xslt-1.0 ×1