Hans Leidekker : msi: Always derive the SourceDir property from the database path.
Alexandre Julliard
julliard at winehq.org
Fri Jan 3 11:23:16 CST 2014
Module: wine
Branch: master
Commit: 41d2b53c5b6d9815f73610aad1ff6bb5e2c5cbbb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=41d2b53c5b6d9815f73610aad1ff6bb5e2c5cbbb
Author: Hans Leidekker <hans at codeweavers.com>
Date: Fri Jan 3 15:00:33 2014 +0100
msi: Always derive the SourceDir property from the database path.
---
dlls/msi/action.c | 42 +++++++++++-------------------------------
1 files changed, 11 insertions(+), 31 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 2a0bf87..aab8c0f 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -424,41 +424,21 @@ static BOOL ui_sequence_exists( MSIPACKAGE *package )
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
{
- LPWSTR source, check;
+ WCHAR *source, *check, *p, *db;
+ DWORD len;
- if (msi_get_property_int( package->db, szInstalled, 0 ))
- {
- HKEY hkey;
+ if (!(db = msi_dup_property( package->db, szOriginalDatabase )))
+ return ERROR_OUTOFMEMORY;
- MSIREG_OpenInstallProps( package->ProductCode, package->Context, NULL, &hkey, FALSE );
- source = msi_reg_get_val_str( hkey, INSTALLPROPERTY_INSTALLSOURCEW );
- RegCloseKey( hkey );
- }
- else
+ if (!(p = strrchrW( db, '\\' )) && !(p = strrchrW( db, '/' )))
{
- LPWSTR p, db;
- DWORD len;
-
- db = msi_dup_property( package->db, szOriginalDatabase );
- if (!db)
- return ERROR_OUTOFMEMORY;
-
- p = strrchrW( db, '\\' );
- if (!p)
- {
- p = strrchrW( db, '/' );
- if (!p)
- {
- msi_free(db);
- return ERROR_SUCCESS;
- }
- }
-
- len = p - db + 2;
- source = msi_alloc( len * sizeof(WCHAR) );
- lstrcpynW( source, db, len );
- msi_free( db );
+ msi_free(db);
+ return ERROR_SUCCESS;
}
+ len = p - db + 2;
+ source = msi_alloc( len * sizeof(WCHAR) );
+ lstrcpynW( source, db, len );
+ msi_free( db );
check = msi_dup_property( package->db, szSourceDir );
if (!check || replace)
More information about the wine-cvs
mailing list