James Hawkins : msi: Fix the RegisterUser action to handle the package context.
Alexandre Julliard
julliard at winehq.org
Wed Jun 18 12:58:29 CDT 2008
Module: wine
Branch: master
Commit: 5f46dfd698e09eda8f29fa5d42e7b524f9d7214b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f46dfd698e09eda8f29fa5d42e7b524f9d7214b
Author: James Hawkins <jhawkins at codeweavers.com>
Date: Wed Jun 18 00:53:39 2008 -0500
msi: Fix the RegisterUser action to handle the package context.
---
dlls/msi/action.c | 6 +++++-
dlls/msi/tests/install.c | 21 +++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 30bb7cf..fa5900c 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -4348,7 +4348,11 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package)
if (!productid)
return ERROR_SUCCESS;
- rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &hkey, TRUE);
+ if (package->Context == MSIINSTALLCONTEXT_MACHINE)
+ rc = MSIREG_OpenLocalSystemInstallProps(package->ProductCode, &hkey, TRUE);
+ else
+ rc = MSIREG_OpenCurrentUserInstallProps(package->ProductCode, &hkey, TRUE);
+
if (rc != ERROR_SUCCESS)
goto end;
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index b066e5b..233080b 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -2719,6 +2719,27 @@ static void test_publish_registeruser(void)
RegDeleteKeyA(props, "");
RegCloseKey(props);
+ /* RegisterUser, machine */
+ r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
+ ok(delete_pf("msitest", FALSE), "File not installed\n");
+
+ sprintf(keypath, keyfmt, "S-1-5-18");
+
+ res = RegOpenKeyA(HKEY_LOCAL_MACHINE, keypath, &props);
+ ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+
+ CHECK_REG_STR(props, "ProductID", "none");
+ CHECK_REG_STR(props, "RegCompany", company);
+ CHECK_REG_STR(props, "RegOwner", owner);
+
+ RegDeleteValueA(props, "ProductID");
+ RegDeleteValueA(props, "RegCompany");
+ RegDeleteValueA(props, "RegOwner");
+ RegDeleteKeyA(props, "");
+ RegCloseKey(props);
+
HeapFree(GetProcessHeap(), 0, company);
HeapFree(GetProcessHeap(), 0, owner);
More information about the wine-cvs
mailing list