Hans Leidekker : msi: Display the directory identifier instead of the full path in standard actions .
Alexandre Julliard
julliard at winehq.org
Wed Jun 9 13:38:14 CDT 2010
Module: wine
Branch: master
Commit: b8ac327e7e967deeb3179aa90c67f81edf2bbd5c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b8ac327e7e967deeb3179aa90c67f81edf2bbd5c
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Jun 9 12:09:21 2010 +0200
msi: Display the directory identifier instead of the full path in standard actions.
---
dlls/msi/action.c | 18 +++++-------------
dlls/msi/files.c | 25 ++++++-------------------
2 files changed, 11 insertions(+), 32 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 565ef66..48948fb 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1063,7 +1063,7 @@ static UINT ITERATE_RemoveFolders( MSIRECORD *row, LPVOID param )
TRACE("folder is %s\n", debugstr_w(full_path));
uirow = MSI_CreateRecord( 1 );
- MSI_RecordSetStringW( uirow, 1, full_path );
+ MSI_RecordSetStringW( uirow, 1, dir );
ui_actiondata( package, szRemoveFolders, uirow );
msiobj_release( &uirow->hdr );
@@ -4257,7 +4257,6 @@ static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param)
PROCESS_INFORMATION info;
BOOL brc;
MSIRECORD *uirow;
- LPWSTR uipath, p;
memset(&si,0,sizeof(STARTUPINFOW));
@@ -4290,14 +4289,11 @@ static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param)
uirow = MSI_CreateRecord( 2 );
MSI_RecordSetStringW( uirow, 1, filename );
- uipath = strdupW( file->TargetPath );
- if ((p = strrchrW( uipath,'\\' ))) *p = 0;
- MSI_RecordSetStringW( uirow, 2, uipath );
+ MSI_RecordSetStringW( uirow, 2, file->Component->Directory );
ui_actiondata( package, szSelfRegModules, uirow );
msiobj_release( &uirow->hdr );
msi_free( FullName );
- msi_free( uipath );
return ERROR_SUCCESS;
}
@@ -4336,7 +4332,6 @@ static UINT ITERATE_SelfUnregModules( MSIRECORD *row, LPVOID param )
PROCESS_INFORMATION pi;
BOOL ret;
MSIRECORD *uirow;
- LPWSTR uipath, p;
memset( &si, 0, sizeof(STARTUPINFOW) );
@@ -4368,14 +4363,11 @@ static UINT ITERATE_SelfUnregModules( MSIRECORD *row, LPVOID param )
uirow = MSI_CreateRecord( 2 );
MSI_RecordSetStringW( uirow, 1, filename );
- uipath = strdupW( file->TargetPath );
- if ((p = strrchrW( uipath,'\\' ))) *p = 0;
- MSI_RecordSetStringW( uirow, 2, uipath );
+ MSI_RecordSetStringW( uirow, 2, file->Component->Directory );
ui_actiondata( package, szSelfUnregModules, uirow );
msiobj_release( &uirow->hdr );
msi_free( cmdline );
- msi_free( uipath );
return ERROR_SUCCESS;
}
@@ -5761,7 +5753,7 @@ static UINT ITERATE_InstallODBCDriver( MSIRECORD *rec, LPVOID param )
uirow = MSI_CreateRecord( 5 );
MSI_RecordSetStringW( uirow, 1, desc );
MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) );
- MSI_RecordSetStringW( uirow, 3, driver_path );
+ MSI_RecordSetStringW( uirow, 3, driver_file->Component->Directory );
ui_actiondata( package, szInstallODBC, uirow );
msiobj_release( &uirow->hdr );
@@ -5834,7 +5826,7 @@ static UINT ITERATE_InstallODBCTranslator( MSIRECORD *rec, LPVOID param )
uirow = MSI_CreateRecord( 5 );
MSI_RecordSetStringW( uirow, 1, desc );
MSI_RecordSetStringW( uirow, 2, MSI_RecordGetString(rec, 2) );
- MSI_RecordSetStringW( uirow, 3, translator_path );
+ MSI_RecordSetStringW( uirow, 3, translator_file->Component->Directory );
ui_actiondata( package, szInstallODBC, uirow );
msiobj_release( &uirow->hdr );
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index fc92f14..f21cd28 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -50,21 +50,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action )
{
MSIRECORD *uirow;
- LPWSTR uipath, p;
- /* the UI chunk */
uirow = MSI_CreateRecord( 9 );
MSI_RecordSetStringW( uirow, 1, f->FileName );
- uipath = strdupW( f->TargetPath );
- p = strrchrW(uipath,'\\');
- if (p)
- p[1]=0;
- MSI_RecordSetStringW( uirow, 9, uipath);
+ MSI_RecordSetStringW( uirow, 9, f->Component->Directory );
MSI_RecordSetInteger( uirow, 6, f->FileSize );
- ui_actiondata( package, action, uirow);
+ ui_actiondata( package, action, uirow );
msiobj_release( &uirow->hdr );
- msi_free( uipath );
- ui_progress( package, 2, f->FileSize, 0, 0);
+ ui_progress( package, 2, f->FileSize, 0, 0 );
}
/* compares the version of a file read from the filesystem and
@@ -987,7 +980,7 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{
MSIRECORD *uirow;
- LPWSTR dir, uipath, p;
+ LPWSTR dir, p;
if ( file->state == msifs_installed )
ERR("removing installed file %s\n", debugstr_w(file->TargetPath));
@@ -1016,17 +1009,11 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
}
file->state = msifs_missing;
- /* the UI chunk */
uirow = MSI_CreateRecord( 9 );
MSI_RecordSetStringW( uirow, 1, file->FileName );
- uipath = strdupW( file->TargetPath );
- p = strrchrW(uipath,'\\');
- if (p)
- p[1]=0;
- MSI_RecordSetStringW( uirow, 9, uipath);
- ui_actiondata( package, szRemoveFiles, uirow);
+ MSI_RecordSetStringW( uirow, 9, file->Component->Directory );
+ ui_actiondata( package, szRemoveFiles, uirow );
msiobj_release( &uirow->hdr );
- msi_free( uipath );
/* FIXME: call ui_progress here? */
}
More information about the wine-cvs
mailing list