Module: wine Branch: master Commit: 01433f0f300f18945e68358ea73db3ad47cda1f6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=01433f0f300f18945e68358ea7...
Author: Hans Leidekker hans@codeweavers.com Date: Tue May 17 11:09:43 2011 +0200
msi: Make sure that the target root directory has a trailing backslash.
---
dlls/msi/action.c | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 42c9274..f41c921 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -2990,6 +2990,25 @@ void msi_clean_path( WCHAR *p ) } }
+static WCHAR *get_target_dir_property( MSIDATABASE *db ) +{ + int len; + WCHAR *path, *target_dir = msi_dup_property( db, szTargetDir ); + + if (!target_dir) return NULL; + + len = strlenW( target_dir ); + if (target_dir[len - 1] == '\') return target_dir; + if ((path = msi_alloc( (len + 2) * sizeof(WCHAR) ))) + { + strcpyW( path, target_dir ); + path[len] = '\'; + path[len + 1] = 0; + } + msi_free( target_dir ); + return path; +} + void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL load_prop ) { FolderList *fl; @@ -3002,7 +3021,7 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa
if (!strcmpW( folder->Directory, szTargetDir )) /* special resolving for target root dir */ { - if (!load_prop || !(path = msi_dup_property( package->db, szTargetDir ))) + if (!load_prop || !(path = get_target_dir_property( package->db ))) { path = msi_dup_property( package->db, szRootDrive ); }