Hi,
Was wondering if somebody could help.  I'm trying to create a patch (MSP)
for my installation and have being following the tutorial on
http://www.tramontana.co.hu/wix/lesson4.php
Which has been very helpful.

I had the original wixpdb for my original installation, which was handy :)

So following the instructions from the above page, I thought that I would
start with the a simple project first..


So created the following wix project:

<!--------------- Original install.wxs - Start ---------------!>
<?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    Compressed="yes"
                        Description="Installs a file that will be patched."
                        Comments="This Product does not install any
executables"
                        InstallerVersion="200"
                        InstallScope="perMachine"
                        />

        <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="Sample2"/>
        </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.ProjectDir)..\Files\org\Readme.txt"/>
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="Sample2"
Guid="{923248E0-B4B5-4c8c-B343-420EE64CEF88}" DiskId="1">
                <File Id="SampleFile2" Name="Sample2.txt"
Source="$(var.ProjectDir)..\Files\org\Readme2.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>
<!--------------- Original install.wxs - End ---------------!>

Build the install.wxs project in the normal way to get the install.wixpdb

Then duplicated the original install.wxs to fixed.wxs and then duplicated
the 2 original txt files, altered the content of both.
Then altered fixed.wxs as follows:
<!--------------- Fixed.wxs - Start ---------------!>
<?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.1"
                Manufacturer="Dynamo Corporation"
                UpgradeCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">

        <Package    Compressed="yes"
                    Description="Installs a file that will be patched."
                    Comments="This Product does not install any executables"
                    InstallerVersion="200"
                    InstallScope="perMachine"
                        />

        <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="Sample2" />
        </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.ProjectDir)..\Files\Patch1\Readme.txt"/>
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="Sample2"
Guid="{923248E0-B4B5-4c8c-B343-420EE64CEF88}" DiskId="1">
                <File Id="SampleFile2" Name="Sample2.txt"
Source="$(var.ProjectDir)..\Files\Patch1\Readme2.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>
<!--------------- Fixed.wxs - End ---------------!>

Build the fixed.wxs project in the normal way to get the fixed.wixpdb

I then created a patch.wxs to create the MSP:
<!--------------- Patch.wxs - Start ---------------!>
<?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"
        OptimizedInstallMode="yes"
        >

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

        <PatchFamily    Id='SamplePatchFamily'
                        ProductCode="48C49ACE-90CF-4161-9C6E-9162115A54DD"
                        Version='1.0.1'
                        Supersede='no'>
            <ComponentRef Id="SampleComponent"/>
        </PatchFamily>
    </Patch>
</Wix>
<!--------------- Patch.wxs - End ---------------!>

Then ran the following commands:
torch -p -xi install.wixpdb fixed.wixpdb -out Diff.wixmst
candle.exe patch.wxs -out patch.wixobj
light.exe patch.wixobj -out patch.wixmsp
pyro.exe patch.wixmsp -out patch.msp -t RTM Diff.wixmst

This build the MSP.

I installed the installed the original msi (install.msi), then installed ran
the patch.msp.  It managed to upgrade the txt files, but to my surprise it
upgraded both txt files!!
I had only specified in the Patch.wxs the component 'SampleComponent' to be
included in the patch..  But seemed to have updated everything..

I check this using Orca and it appeared that the it was updating all
components.

Is there a know problem or am I doing something wrong ?

Thanks

whgibbo
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to