On Thu, 2011-03-10 at 02:20 +0100, David Hedberg wrote:
+static UINT msi_set_patch_offsets(MSIPACKAGE *package) +{
- static const WCHAR query_media[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','M','e','d','i','a',' ',
'W','H','E','R','E',' ','S','o','u','r','c','e',' ','I','S',' ','N','O','T',' ','N','U','L','L',0};
You should order the list by DiskId to protect against installers with multiple sources for a given file sequence number. We do this elsewhere, and although I'm not sure it matches native it will at least give consistent behavior.
Also, MSDN tells me the Source column is ignored if the Cabinet column is empty.
UINT msi_apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch ) { UINT i, r = ERROR_SUCCESS; @@ -640,6 +796,7 @@ UINT msi_apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINF return r;
msi_set_media_source_prop( package );
- msi_set_patch_offsets( package );
There can be more than one transform in the patch that modifies the Media table. It's unlikely, but it may mean that offsets need to be applied after each transform that modifies the Media table instead of after each patch.