James Hawkins : msi:
Any value of WindowsInstaller besides 0 means the product is installed.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jun 27 09:11:21 CDT 2007
Module: wine
Branch: master
Commit: 3bf32f27005a0e529d0ef614d407a85fee8f5238
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3bf32f27005a0e529d0ef614d407a85fee8f5238
Author: James Hawkins <truiken at gmail.com>
Date: Tue Jun 26 19:01:37 2007 -0700
msi: Any value of WindowsInstaller besides 0 means the product is installed.
---
dlls/msi/msi.c | 12 +++---------
dlls/msi/tests/msi.c | 8 ++++++++
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index fce1bc5..497083e 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -799,17 +799,11 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
if (rc != ERROR_SUCCESS)
goto end;
- switch (state)
- {
- case 1:
- /* default */
+ if (state)
state = INSTALLSTATE_DEFAULT;
- break;
- default:
- FIXME("Unknown install state read from registry (%i)\n",state);
+ else
state = INSTALLSTATE_UNKNOWN;
- break;
- }
+
end:
RegCloseKey(props);
RegCloseKey(hkey);
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 4e42fea..810992c 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -427,6 +427,14 @@ static void test_MsiQueryProductState(void)
state = MsiQueryProductStateA(prodcode);
ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
+ data = 2;
+ res = RegSetValueExA(props, "WindowsInstaller", 0, REG_DWORD, (const BYTE *)&data, sizeof(DWORD));
+ ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+
+ /* WindowsInstaller value is not 1 */
+ state = MsiQueryProductStateA(prodcode);
+ ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
+
RegDeleteKeyA(userkey, "");
/* user product key does not exist */
More information about the wine-cvs
mailing list