James Hawkins : msi: Set the property specified by the Source attribute of the Media table when applying a patch .

Alexandre Julliard julliard at winehq.org
Mon Dec 15 08:27:23 CST 2008


Module: wine
Branch: master
Commit: c059ceb5b0dd13c9aa077aaede8de680479dd874
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c059ceb5b0dd13c9aa077aaede8de680479dd874

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Sun Dec 14 21:07:28 2008 -0600

msi: Set the property specified by the Source attribute of the Media table when applying a patch.

---

 dlls/msi/action.c |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 481c547..3a32a06 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -480,6 +480,44 @@ static UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si
     return ret;
 }
 
+static UINT msi_set_media_source_prop(MSIPACKAGE *package)
+{
+    MSIQUERY *view;
+    MSIRECORD *rec = NULL;
+    LPWSTR patch;
+    LPCWSTR prop;
+    UINT r;
+
+    static const WCHAR szPatch[] = {'P','A','T','C','H',0};
+    static const WCHAR query[] = {'S','E','L','E','C','T',' ',
+        '`','S','o','u','r','c','e','`',' ','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};
+
+    r = MSI_DatabaseOpenViewW(package->db, query, &view);
+    if (r != ERROR_SUCCESS)
+        return r;
+
+    r = MSI_ViewExecute(view, 0);
+    if (r != ERROR_SUCCESS)
+        goto done;
+
+    if (MSI_ViewFetch(view, &rec) == ERROR_SUCCESS)
+    {
+        prop = MSI_RecordGetString(rec, 1);
+        patch = msi_dup_property(package, szPatch);
+        MSI_SetPropertyW(package, prop, patch);
+        msi_free(patch);
+    }
+
+done:
+    if (rec) msiobj_release(&rec->hdr);
+    msiobj_release(&view->hdr);
+
+    return r;
+}
+
 static UINT msi_parse_patch_summary( MSIPACKAGE *package, MSIDATABASE *patch_db )
 {
     MSISUMMARYINFO *si;
@@ -515,6 +553,8 @@ static UINT msi_parse_patch_summary( MSIPACKAGE *package, MSIDATABASE *patch_db
     msi_free( substorage );
     msiobj_release( &si->hdr );
 
+    msi_set_media_source_prop(package);
+
     return r;
 }
 




More information about the wine-cvs mailing list