Mike McCormack : msi:
Split msi_set_sourcedir_props into a separate function.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Nov 20 05:52:28 CST 2006
Module: wine
Branch: master
Commit: b921118f145227e194b8b312c6ee9f7a1b39b837
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b921118f145227e194b8b312c6ee9f7a1b39b837
Author: Mike McCormack <mike at codeweavers.com>
Date: Mon Nov 20 16:27:36 2006 +0900
msi: Split msi_set_sourcedir_props into a separate function.
---
dlls/msi/action.c | 37 +++++++++++++++++++++++--------------
1 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 41d0a19..c49d26d 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -3851,10 +3851,30 @@ static UINT ACTION_ForceReboot(MSIPACKAG
return ERROR_INSTALL_SUSPEND;
}
+UINT msi_set_sourcedir_props(MSIPACKAGE *package)
+{
+ LPWSTR p, source;
+ DWORD len;
+
+ p = strrchrW( package->PackagePath, '\\' );
+ if (!p)
+ return ERROR_SUCCESS;
+
+ len = p - package->PackagePath + 2;
+ source = msi_alloc( len * sizeof(WCHAR) );
+ lstrcpynW( source, package->PackagePath, len );
+
+ MSI_SetPropertyW( package, cszSourceDir, source );
+ MSI_SetPropertyW( package, cszSOURCEDIR, source );
+
+ msi_free( source );
+
+ return ERROR_SUCCESS;
+}
+
static UINT ACTION_ResolveSource(MSIPACKAGE* package)
{
- DWORD attrib, len;
- LPWSTR ptr, source;
+ DWORD attrib;
UINT rc;
/*
@@ -3864,18 +3884,7 @@ static UINT ACTION_ResolveSource(MSIPACK
if (!package->PackagePath)
return ERROR_SUCCESS;
- ptr = strrchrW(package->PackagePath, '\\');
- if (!ptr)
- return ERROR_SUCCESS;
-
- len = ptr - package->PackagePath + 2;
- source = msi_alloc(len * sizeof(WCHAR));
- lstrcpynW(source, package->PackagePath, len);
-
- MSI_SetPropertyW(package, cszSourceDir, source);
- MSI_SetPropertyW(package, cszSOURCEDIR, source);
-
- msi_free(source);
+ msi_set_sourcedir_props(package);
attrib = GetFileAttributesW(package->PackagePath);
if (attrib == INVALID_FILE_ATTRIBUTES)
More information about the wine-cvs
mailing list