James Hawkins : msi: Factor out publishing icon files.

Alexandre Julliard julliard at winehq.org
Tue Jun 24 06:45:36 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Mon Jun 23 22:56:56 2008 -0500

msi: Factor out publishing icon files.

---

 dlls/msi/action.c |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 67f06df..9d6fe7b 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -3261,7 +3261,7 @@ static UINT ACTION_CreateShortcuts(MSIPACKAGE *package)
     return rc;
 }
 
-static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param)
+static UINT ITERATE_PublishIcon(MSIRECORD *row, LPVOID param)
 {
     MSIPACKAGE* package = (MSIPACKAGE*)param;
     HANDLE the_file;
@@ -3320,6 +3320,25 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param)
     return ERROR_SUCCESS;
 }
 
+static UINT msi_publish_icons(MSIPACKAGE *package)
+{
+    UINT r;
+    MSIQUERY *view;
+
+    static const WCHAR query[]= {
+        'S','E','L','E','C','T',' ','*',' ',
+        'F','R','O','M',' ','`','I','c','o','n','`',0};
+
+    r = MSI_DatabaseOpenViewW(package->db, query, &view);
+    if (r == ERROR_SUCCESS)
+    {
+        MSI_IterateRecords(view, NULL, ITERATE_PublishIcon, package);
+        msiobj_release(&view->hdr);
+    }
+
+    return ERROR_SUCCESS;
+}
+
 static BOOL msi_check_publish(MSIPACKAGE *package)
 {
     MSIFEATURE *feature;
@@ -3343,13 +3362,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
 {
     UINT rc;
     LPWSTR packname;
-    MSIQUERY * view;
     MSISOURCELISTINFO *info;
     MSIMEDIADISK *disk;
-    static const WCHAR Query[]=
-        {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
-         '`','I','c','o','n','`',0};
-    /* for registry stuff */
     HKEY hkey=0;
     HKEY hukey=0;
     HKEY hudkey=0, props=0;
@@ -3372,15 +3386,6 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
     if (!msi_check_publish(package))
         return ERROR_SUCCESS;
 
-    /* write out icon files */
-
-    rc = MSI_DatabaseOpenViewW(package->db, Query, &view);
-    if (rc == ERROR_SUCCESS)
-    {
-        MSI_IterateRecords(view, NULL, ITERATE_PublishProduct, package);
-        msiobj_release(&view->hdr);
-    }
-
     /* ok there is a lot more done here but i need to figure out what */
 
     if (package->Context == MSIINSTALLCONTEXT_MACHINE)
@@ -3522,6 +3527,8 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
                                    disk->disk_id, disk->volume_label, disk->disk_prompt);
     }
 
+    msi_publish_icons(package);
+
 end:
     RegCloseKey(hkey);
     RegCloseKey(hukey);




More information about the wine-cvs mailing list