Hi,
I've found an issue in patch creation using pyro. It is not easy to 
reproduce with "sample code", but in real life it is very likely to occur.

Pyro always sets the PatchAdded and Compressed attributes on files that 
need to be patched and that's not always right.

It works with small files or without using delta. In this case whole 
files are used (ignoring the delta switch if it's on) and modified files 
have the aforementioned attributes set - everything is consistent and 
works fine.

But...
I the files are large enough and the -delta switch is on, things go 
wrong. The delta is computed and the result is put into Patch Table 
Header column, but pyro still "thinks" that the whole file is included 
as a stream in the media and sets the PatchAdded and Compressed 
attributes. An inconsistency occurs.

The patch works fine, but if we create another patch, using the same 
procedure, it fails. The installation of the second patch succeeds, but 
repairing the installation causes Error 1328/2920.

Example:
Take the samples from Windows Installer Help, but instead of using text 
files, try to use something else (the installer packages of consequent 
versions of WiX would do).
We also need to modify the patch.wxs in order to be able to build two 
consecutive patches of it. In my tests it looked like this:

<?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="$(var.Media)" Cabinet="RTM_$(var.Media).cab">
             <PatchBaseline Id="RTM_$(var.Media)"/>
         </Media>

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

     <Fragment>
         <PatchFamily Id='SamplePatchFamily' Version='1.0.0.$(var.Media)'>
             <ComponentRef Id="SampleComponent"/>
         </PatchFamily>
     </Fragment>
</Wix>

the difference is that variable $(var.Media) is used.

and make.bat:
candle.exe -dVersion=1.0 product.wxs
light.exe product.wixobj -out 1.0\product.msi
candle.exe -dVersion=1.1 sample.wxs
light.exe product.wixobj -out 1.1\product.msi
candle.exe -dVersion=1.2 sample.wxs
light.exe product.wixobj -out 1.2\product.msi

rem patch 1.0->1.1
candle Patch.wxs -dMedia=5000
light Patch.wixobj -out Patch.WixMsp
torch.exe -p -xi 1.0\product.wixpdb 1.1\product.wixpdb -out 
Patch\diff.wixmst
pyro -v -delta Patch.WixMsp -out patch_11.msp -t RTM_5000 Patch\diff.WixMst

rem patch 1.1->1.2
candle Patch.wxs -dMedia=5100
light Patch.wixobj -out Patch.WixMsp
torch.exe -p -xi 1.1\product.wixpdb 1.2\product.wixpdb -out 
Patch\diff.wixmst
pyro -v -delta Patch.WixMsp -out patch_12.msp -t RTM_5100 Patch\diff.WixMst

Having everything ready let's test it:
msiexec /i 1.0\product.msi
msiexec /p patch_11.msp;patch_12.msp REINSTALL=ALL
It fails with Error 1328 or 2920 if the package is not compressed

Another approach:
msiexec /i 1.0\product.msi
msiexec /p patch_11.msp REINSTALL=ALL
msiexec /p patch_12.msp REINSTALL=ALL
msiexec /i 1.0\product.msi REINSTALL=ALL
Fails with Error 1328 or 2920 if the package is not compressed

Is this really a bug in WiX or maybe I do something wrong?


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to