msi: update LastSequence for empty media as well

Daniel Jeliński djelinski1 at gmail.com
Sat Jun 8 15:37:36 CDT 2013


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130608/aeff5cbe/attachment.html>
-------------- next part --------------
From 3a4038516e2bccfa175854758eed2a97440bfce3 Mon Sep 17 00:00:00 2001
From: Daniel Jelinski <djelinski1 at gmail.com>
Date: Sat, 8 Jun 2013 22:22:19 +0200
Subject: msi: update LastSequence for empty media as well

patch_offset_* functions assume that there is only one media with untransformed LastSequence.
However, the current code does not transform LastSequence field if it finds media without files.
This caused one file not to be updated by .NET 2.0 SP2 installer. The sequence was as follows:
- msi encountered an empty media, LastSequence = 1001
- next media was not empty. Now file table was filled, but set_patch_offsets tried the previous package again
- the first file from the list was assigned to the previous (empty) media
- the rest of files was correctly assigned to the new media.
Later the installer was looking for the first file in the wrong cab, and of course couldn't find it.
This patch fixes the issue by transforming media's LastSequence even if the list of files is empty.
Reported as bug 30681.
---
 dlls/msi/patch.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/patch.c b/dlls/msi/patch.c
index d97ab2e..d7eef7c 100644
--- a/dlls/msi/patch.c
+++ b/dlls/msi/patch.c
@@ -551,7 +551,6 @@ static UINT set_patch_offsets( MSIDATABASE *db )
         pos = patch_offset_list_create();
         patch_offset_get_files( db, last_sequence, pos );
         patch_offset_get_patches( db, last_sequence, pos );
-        if (pos->count)
         {
             UINT offset = db->media_transform_offset - pos->min;
             last_sequence = offset + pos->max;
@@ -559,7 +558,8 @@ static UINT set_patch_offsets( MSIDATABASE *db )
             /* FIXME: this is for the patch table, which is not yet properly transformed */
             last_sequence += pos->min;
             pos->offset_to_apply = offset;
-            patch_offset_modify_db( db, pos );
+            if (pos->count)
+                patch_offset_modify_db( db, pos );
 
             MSI_RecordSetInteger( rec, 2, last_sequence );
             r = MSI_ViewModify( view, MSIMODIFY_UPDATE, rec );
-- 
1.7.5.4


More information about the wine-patches mailing list