Wix:PatchFamily不';t过滤器转换正确(完全正确)

Wix:PatchFamily不';t过滤器转换正确(完全正确),wix,windows-installer,patch,Wix,Windows Installer,Patch,首先,我使用的是WiX版本3.5.2519.0,但我也在最新的3.6版本上进行了测试,结果相同 我很难找到Exactly PatchFamily如何仅过滤火炬生成差异的某些部分。按照手册中的示例(“使用纯WiX构建补丁”),我已经能够成功生成一个基本的安装程序+补丁,该补丁可以按照宣传的方式工作。然而,当我试图扩展这个例子时,我遇到了一些问题 简短版本: 我将一个新组件B添加到Product.wxs中与原始组件a相同的文件夹中,然后构建安装程序的1.0版和1.1版。组件A和B的文件在版本1.0和

首先,我使用的是WiX版本3.5.2519.0,但我也在最新的3.6版本上进行了测试,结果相同

我很难找到Exactly PatchFamily如何仅过滤火炬生成差异的某些部分。按照手册中的示例(“使用纯WiX构建补丁”),我已经能够成功生成一个基本的安装程序+补丁,该补丁可以按照宣传的方式工作。然而,当我试图扩展这个例子时,我遇到了一些问题

简短版本: 我将一个新组件B添加到Product.wxs中与原始组件a相同的文件夹中,然后构建安装程序的1.0版和1.1版。组件A和B的文件在版本1.0和1.1之间更改

使用torch,我生成安装程序1.0和1.1之间的转换

使用pyro,我创建了msp补丁。请注意,我没有更改Patch.wxs,因此PatchFamily元素仍然只包含组件a的ComponentRef,而不是组件B

基于此,我假设当我应用补丁时,组件A的文件将被更新,但组件B的文件将保持不变。换句话说,该pyro将从包含组件A和B的转换的torch中获取总转换,但随后过滤掉在PatchFamily元素中找不到的所有转换操作,因此最后一个补丁中剩下的就是组件A的转换

显然我错了,所以我真正想知道的是,如果可能的话,我如何在创建补丁时从diff中过滤掉不需要的变换


详细版本,如果需要文件内容和使用的命令:

Product.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="48C49ACE-90CF-4161-9C6E-9162115A54DD"
        Name="WiX Patch Example Product"
        Language="1033"
        Version="1.0.0"
        Manufacturer="Dynamo Corporation"
        UpgradeCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">
        <Package Description="Installs a file that will be patched."
            Comments="This Product does not install any executables"
            InstallerVersion="200"
            Compressed="yes" />

        <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
        <FeatureRef Id="SampleProductFeature"/>
    </Product>

    <Fragment>
        <Feature Id="SampleProductFeature" Title="Sample Product Feature" Level="1">
            <ComponentRef Id="SampleComponent" />
            <ComponentRef Id="SampleComponent2" />
        </Feature>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1983}" DiskId="1">
                <File Id="SampleFile" Name="Sample.txt" Source=".\$(var.Version)\Sample.txt" />
            </Component>
            <Component Id="SampleComponent2" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1984}" DiskId="1">
                <File Id="SampleFile2" Name="Sample2.txt" Source=".\$(var.Version)\Sample2.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="SampleProductFolder" Name="Patch Sample Directory">
                </Directory>
            </Directory>
        </Directory>
    </Fragment>
</Wix>
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="48C49ACE-90CF-4161-9C6E-9162115A54DD"
        Name="WiX Patch Example Product"
        Language="1033"
        Version="1.0.0"
        Manufacturer="Dynamo Corporation"
        UpgradeCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">
        <Package Description="Installs a file that will be patched."
            Comments="This Product does not install any executables"
            InstallerVersion="200"
            Compressed="yes" />

        <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
        <FeatureRef Id="SampleProductFeature"/>
    </Product>

    <Fragment>
        <Feature Id="SampleProductFeature" Title="Sample Product Feature" Level="1">
            <ComponentRef Id="SampleComponent" />
            <ComponentRef Id="SampleComponent2" />
        </Feature>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1983}" DiskId="1">
                <File Id="SampleFile" Name="Sample.txt" Source=".\$(var.Version)\Sample.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent2" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1984}" DiskId="1">
                <File Id="SampleFile2" Name="Sample2.txt" Source=".\$(var.Version)\Sample2.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="SampleProductFolder" Name="Patch Sample Directory">
                </Directory>
            </Directory>
        </Directory>
    </Fragment>
</Wix>

编辑: 正如Bob Arnson所指出的,Fragment元素“成为一个不可变的原子单元,可以完全包含在产品中,也可以从产品中排除”,因此为了单独更新文件,必须在不同的片段中定义它们。知道这一点当然很好,因为到目前为止,我只将片段作为分离元素引用和元素定义的一种方式。如果有人对Product.wxs感兴趣,以下是Product.wxs的工作版本:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="48C49ACE-90CF-4161-9C6E-9162115A54DD"
        Name="WiX Patch Example Product"
        Language="1033"
        Version="1.0.0"
        Manufacturer="Dynamo Corporation"
        UpgradeCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">
        <Package Description="Installs a file that will be patched."
            Comments="This Product does not install any executables"
            InstallerVersion="200"
            Compressed="yes" />

        <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
        <FeatureRef Id="SampleProductFeature"/>
    </Product>

    <Fragment>
        <Feature Id="SampleProductFeature" Title="Sample Product Feature" Level="1">
            <ComponentRef Id="SampleComponent" />
            <ComponentRef Id="SampleComponent2" />
        </Feature>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1983}" DiskId="1">
                <File Id="SampleFile" Name="Sample.txt" Source=".\$(var.Version)\Sample.txt" />
            </Component>
            <Component Id="SampleComponent2" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1984}" DiskId="1">
                <File Id="SampleFile2" Name="Sample2.txt" Source=".\$(var.Version)\Sample2.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="SampleProductFolder" Name="Patch Sample Directory">
                </Directory>
            </Directory>
        </Directory>
    </Fragment>
</Wix>
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="48C49ACE-90CF-4161-9C6E-9162115A54DD"
        Name="WiX Patch Example Product"
        Language="1033"
        Version="1.0.0"
        Manufacturer="Dynamo Corporation"
        UpgradeCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">
        <Package Description="Installs a file that will be patched."
            Comments="This Product does not install any executables"
            InstallerVersion="200"
            Compressed="yes" />

        <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
        <FeatureRef Id="SampleProductFeature"/>
    </Product>

    <Fragment>
        <Feature Id="SampleProductFeature" Title="Sample Product Feature" Level="1">
            <ComponentRef Id="SampleComponent" />
            <ComponentRef Id="SampleComponent2" />
        </Feature>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1983}" DiskId="1">
                <File Id="SampleFile" Name="Sample.txt" Source=".\$(var.Version)\Sample.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent2" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1984}" DiskId="1">
                <File Id="SampleFile2" Name="Sample2.txt" Source=".\$(var.Version)\Sample2.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="SampleProductFolder" Name="Patch Sample Directory">
                </Directory>
            </Directory>
        </Directory>
    </Fragment>
</Wix>


两个组件都在同一个片段中,因此它们都包含在补丁中。如果你不想这样,就把它们放在不同的片段中。

哦,哇,答案太简单了,我完全忽略了它。我检查了Patch、PatchFamily和Component的可能属性和子节点,但没有忽略最基本的构建块,但现在我看到Fragment元素的文档中这么说:“一旦定义,片段就变成了一个不可变的原子单元,它可以完全包含在产品中,也可以从产品中排除。”……好吧,无论如何,感谢您这么快的回答。