Commit 41d2b53c authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Always derive the SourceDir property from the database path.

parent 2a8a1452
...@@ -424,41 +424,21 @@ static BOOL ui_sequence_exists( MSIPACKAGE *package ) ...@@ -424,41 +424,21 @@ static BOOL ui_sequence_exists( MSIPACKAGE *package )
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace) 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 )) if (!(db = msi_dup_property( package->db, szOriginalDatabase )))
{ return ERROR_OUTOFMEMORY;
HKEY hkey;
MSIREG_OpenInstallProps( package->ProductCode, package->Context, NULL, &hkey, FALSE ); if (!(p = strrchrW( db, '\\' )) && !(p = strrchrW( db, '/' )))
source = msi_reg_get_val_str( hkey, INSTALLPROPERTY_INSTALLSOURCEW );
RegCloseKey( hkey );
}
else
{ {
LPWSTR p, db; msi_free(db);
DWORD len; return ERROR_SUCCESS;
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 );
} }
len = p - db + 2;
source = msi_alloc( len * sizeof(WCHAR) );
lstrcpynW( source, db, len );
msi_free( db );
check = msi_dup_property( package->db, szSourceDir ); check = msi_dup_property( package->db, szSourceDir );
if (!check || replace) if (!check || replace)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment