3

まず第一に、私は WiX バージョン 3.5.2519.0 を使用していますが、これを最新の 3.6 リリースでもテストしましたが、同じ結果が得られました。

トーチで生成された差分の特定の部分のみを PatchFamily がどのように正確に除外できるかを見つけるのに苦労しています。マニュアルの例 (「純粋な WiX を使用してパッチを作成する」http://wix.sourceforge.net/manual-wix3/wix_patching.htm ) に従って、次のように機能する基本的なインストーラー + パッチを正常に生成できました。宣伝した。ただし、その例を拡張しようとすると、いくつかの問題が発生します。

短いバージョン: Product.wxs の元のコンポーネント A と同じフォルダーに新しいコンポーネント B を追加し、バージョン 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 の変換です。

どうやら私が間違っていたようです。パッチを作成するときに、可能であれば、差分から不要な変換を実際に除外する方法を本当に知りたいのですか?


ファイルの内容と使用されたコマンドが必要な場合は、詳細バージョン:

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>

Patch.wx:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Patch 
        AllowRemoval="yes"
        Manufacturer="Dynamo Corp" 
        MoreInfoURL="http://www.dynamocorp.com/"
        DisplayName="Sample Patch" 
        Description="Small Update Patch" 
        Classification="Update"
        >

        <Media Id="5000" Cabinet="RTM.cab">
            <PatchBaseline Id="RTM"/>
        </Media>

        <PatchFamilyRef Id="SamplePatchFamily"/>
    </Patch>

    <Fragment>    
        <PatchFamily Id='SamplePatchFamily' Version='1.0.0.0' Supersede='yes'>
            <ComponentRef Id="SampleComponent"/>
        </PatchFamily>
    </Fragment>
</Wix>

1.0 と 1.1 の 2 つのサブフォルダーには、さまざまな (異なる) 内容の Sample.txt と Sample2.txt が含まれています。

コマンド:

candle.exe -dVersion=1.0 product.wxs
light.exe product.wixobj -out 1.0\product.msi
candle.exe -dVersion=1.1 product.wxs
light.exe product.wixobj -out 1.1\product.msi
torch.exe -p -xi 1.0\product.wixpdb 1.1\product.wixpdb -out patch\diff.wixmst
candle.exe patch.wxs
light.exe patch.wixobj -out patch\patch.wixmsp
pyro.exe patch\patch.wixmsp -out patch\patch.msp -t RTM patch\diff.wixmst

編集:ボブ・アーンソンが指摘するのに十分親切だったように、フラグメント要素は「製品に完全に含めることも除外することもできる不変のアトミックユニットになる」ため、ファイルを個別に更新するには、異なるフラグメントで定義する必要があります. これまでのところ、フラグメントを要素参照と要素定義を分離する単なる方法として扱ってきたので、これは確かに良いことでした。誰かがリモートで興味を持っている場合、次は 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>
        </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>
4

1 に答える 1

3

どちらのコンポーネントも同じフラグメントに含まれているため、両方ともパッチに含まれています。それが望ましくない場合は、それらを別のフラグメントに入れます。

于 2012-11-13T19:01:09.790 に答える