James Hawkins : msi: SourceDir is formed from the path of OriginalDatabase.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 08:39:09 CST 2008


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

Author: James Hawkins <truiken at gmail.com>
Date:   Sat Jan  5 13:46:39 2008 -0700

msi: SourceDir is formed from the path of OriginalDatabase.

---

 dlls/msi/action.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 95ecf4a..a96d2b3 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -60,6 +60,8 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI)
  * consts and values used
  */
 static const WCHAR c_colon[] = {'C',':','\\',0};
+static const WCHAR szOriginalDatabase[] =
+    {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
 
 static const WCHAR szCreateFolders[] =
     {'C','r','e','a','t','e','F','o','l','d','e','r','s',0};
@@ -610,17 +612,24 @@ BOOL ui_sequence_exists( MSIPACKAGE *package )
 
 static UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
 {
-    LPWSTR p;
+    LPWSTR p, db;
     LPWSTR source, check;
     DWORD len;
 
-    p = strrchrW( package->PackagePath, '\\' );
+    db = msi_dup_property( package, szOriginalDatabase );
+    if (!db)
+        return ERROR_OUTOFMEMORY;
+
+    p = strrchrW( db, '\\' );
     if (!p)
+    {
+        msi_free(db);
         return ERROR_SUCCESS;
+    }
 
-    len = p - package->PackagePath + 2;
+    len = p - db + 2;
     source = msi_alloc( len * sizeof(WCHAR) );
-    lstrcpynW( source, package->PackagePath, len );
+    lstrcpynW( source, db, len );
 
     check = msi_dup_property( package, cszSourceDir );
     if (!check || replace)
@@ -634,6 +643,7 @@ static UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
 
     msi_free( check );
     msi_free( source );
+    msi_free( db );
 
     return ERROR_SUCCESS;
 }
@@ -3872,8 +3882,6 @@ static UINT msi_get_local_package_name( LPWSTR path )
 
 static UINT msi_make_package_local( MSIPACKAGE *package, HKEY hkey )
 {
-    static const WCHAR szOriginalDatabase[] =
-        {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
     WCHAR packagefile[MAX_PATH];
     LPWSTR msiFilePath;
     HKEY props;




More information about the wine-cvs mailing list