James Hawkins : msi: Determine the installation context after reading properties from the command line .
Alexandre Julliard
julliard at winehq.org
Wed Jun 18 12:58:07 CDT 2008
Module: wine
Branch: master
Commit: 5f11262da9249ec1f590db7bfe0d8d93c18d900a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f11262da9249ec1f590db7bfe0d8d93c18d900a
Author: James Hawkins <jhawkins at codeweavers.com>
Date: Wed Jun 18 00:50:28 2008 -0500
msi: Determine the installation context after reading properties from the command line.
---
dlls/msi/action.c | 25 +++++++++++++++++++++++++
dlls/msi/package.c | 26 --------------------------
2 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index f6c82ac..ca7da98 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -648,6 +648,30 @@ static UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
return ERROR_SUCCESS;
}
+static UINT msi_set_context(MSIPACKAGE *package)
+{
+ WCHAR val[10];
+ DWORD sz = 10;
+ DWORD num;
+ UINT r;
+
+ static const WCHAR szOne[] = {'1',0};
+ static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0};
+
+ package->Context = MSIINSTALLCONTEXT_USERUNMANAGED;
+
+ r = MSI_GetPropertyW(package, szAllUsers, val, &sz);
+ if (r == ERROR_SUCCESS)
+ {
+ num = atolW(val);
+ if (num == 1 || num == 2)
+ package->Context = MSIINSTALLCONTEXT_MACHINE;
+ }
+
+ MSI_SetPropertyW(package, szAllUsers, szOne);
+ return ERROR_SUCCESS;
+}
+
/****************************************************
* TOP level entry points
*****************************************************/
@@ -710,6 +734,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
/* properties may have been added by a transform */
msi_clone_properties( package );
+ msi_set_context( package );
if ( (msi_get_property_int(package, szUILevel, 0) & INSTALLUILEVEL_MASK) >= INSTALLUILEVEL_REDUCED )
{
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index f11b068..0b9dacf 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -760,30 +760,6 @@ static UINT msi_load_admin_properties(MSIPACKAGE *package)
return r;
}
-static UINT msi_set_context(MSIPACKAGE *package)
-{
- WCHAR val[10];
- DWORD sz = 10;
- DWORD num;
- UINT r;
-
- static const WCHAR szOne[] = {'1',0};
- static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0};
-
- package->Context = MSIINSTALLCONTEXT_USERUNMANAGED;
-
- r = MSI_GetPropertyW(package, szAllUsers, val, &sz);
- if (r == ERROR_SUCCESS)
- {
- num = atolW(val);
- if (num == 1 || num == 2)
- package->Context = MSIINSTALLCONTEXT_MACHINE;
- }
-
- MSI_SetPropertyW(package, szAllUsers, szOne);
- return ERROR_SUCCESS;
-}
-
MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
{
static const WCHAR szLevel[] = { 'U','I','L','e','v','e','l',0 };
@@ -823,8 +799,6 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
if (package->WordCount & MSIWORDCOUNT_ADMINISTRATIVE)
msi_load_admin_properties( package );
-
- msi_set_context( package );
}
return package;
More information about the wine-cvs
mailing list