Commit fc73c9db authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Fix install state detection for registry components.

parent 4fb5872b
...@@ -2217,7 +2217,7 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, ...@@ -2217,7 +2217,7 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
else else
{ {
if (lstrlenW(val) > 2 && if (lstrlenW(val) > 2 &&
val[0] >= '0' && val[0] <= '9' && val[1] >= '0' && val[1] <= '9') val[0] >= '0' && val[0] <= '9' && val[1] >= '0' && val[1] <= '9' && val[2] != ':')
{ {
*pdwState = INSTALLSTATE_SOURCE; *pdwState = INSTALLSTATE_SOURCE;
} }
......
...@@ -1646,10 +1646,10 @@ static void test_MsiQueryComponentState(void) ...@@ -1646,10 +1646,10 @@ static void test_MsiQueryComponentState(void)
ok(state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state); ok(state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
ok(error == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", error); ok(error == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", error);
res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"01", 3); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"01:", 4);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
/* bad INSTALLSTATE_SOURCE */ /* registry component */
state = MAGIC_ERROR; state = MAGIC_ERROR;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state); r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment