msi: automation: Implement Session::EvaluateCondition.
This commit is contained in:
parent
75222d7452
commit
2d8c2ce6d6
|
@ -956,6 +956,15 @@ static HRESULT WINAPI SessionImpl_Invoke(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DISPID_SESSION_EVALUATECONDITION:
|
||||||
|
if (wFlags & DISPATCH_METHOD) {
|
||||||
|
hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr);
|
||||||
|
if (FAILED(hr)) return hr;
|
||||||
|
V_VT(pVarResult) = VT_I4;
|
||||||
|
V_I4(pVarResult) = MsiEvaluateConditionW(This->msiHandle, V_BSTR(&varg0));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case DISPID_SESSION_SETINSTALLLEVEL:
|
case DISPID_SESSION_SETINSTALLLEVEL:
|
||||||
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
|
hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr);
|
||||||
if (FAILED(hr)) return hr;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
|
@ -172,6 +172,13 @@ library WindowsInstaller
|
||||||
msiRunModeCommit = 18
|
msiRunModeCommit = 18
|
||||||
} MsiRunMode;
|
} MsiRunMode;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
msiEvaluateConditionFalse = 0,
|
||||||
|
msiEvaluateConditionTrue = 1,
|
||||||
|
msiEvaluateConditionNone = 2,
|
||||||
|
msiEvaluateConditionError = 3
|
||||||
|
} _MsiEvaluateCondition; /* Added underscore to avoid conflict with function name */
|
||||||
|
|
||||||
[ uuid(000C109E-0000-0000-C000-000000000046) ]
|
[ uuid(000C109E-0000-0000-C000-000000000046) ]
|
||||||
dispinterface Session
|
dispinterface Session
|
||||||
{
|
{
|
||||||
|
@ -197,6 +204,8 @@ library WindowsInstaller
|
||||||
Database* Database();
|
Database* Database();
|
||||||
[id(DISPID_SESSION_DOACTION)]
|
[id(DISPID_SESSION_DOACTION)]
|
||||||
MsiDoActionStatus DoAction([in] BSTR Action);
|
MsiDoActionStatus DoAction([in] BSTR Action);
|
||||||
|
[id(DISPID_SESSION_EVALUATECONDITION)]
|
||||||
|
_MsiEvaluateCondition EvaluateCondition([in] BSTR Expression);
|
||||||
[id(DISPID_SESSION_FEATURECURRENTSTATE), propget]
|
[id(DISPID_SESSION_FEATURECURRENTSTATE), propget]
|
||||||
MsiInstallState FeatureCurrentState([in] BSTR Feature);
|
MsiInstallState FeatureCurrentState([in] BSTR Feature);
|
||||||
[id(DISPID_SESSION_FEATUREREQUESTSTATE), propget]
|
[id(DISPID_SESSION_FEATUREREQUESTSTATE), propget]
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#define DISPID_SESSION_MODE 4
|
#define DISPID_SESSION_MODE 4
|
||||||
#define DISPID_SESSION_DATABASE 5
|
#define DISPID_SESSION_DATABASE 5
|
||||||
#define DISPID_SESSION_DOACTION 8
|
#define DISPID_SESSION_DOACTION 8
|
||||||
|
#define DISPID_SESSION_EVALUATECONDITION 10
|
||||||
#define DISPID_SESSION_FEATURECURRENTSTATE 13
|
#define DISPID_SESSION_FEATURECURRENTSTATE 13
|
||||||
#define DISPID_SESSION_FEATUREREQUESTSTATE 14
|
#define DISPID_SESSION_FEATUREREQUESTSTATE 14
|
||||||
#define DISPID_SESSION_SETINSTALLLEVEL 19
|
#define DISPID_SESSION_SETINSTALLLEVEL 19
|
||||||
|
|
|
@ -1106,20 +1106,17 @@ static void test_Session(IDispatch *pSession)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Session::EvaluateCondition */
|
/* Session::EvaluateCondition */
|
||||||
todo_wine
|
hr = Session_EvaluateCondition(pSession, NULL, &myint);
|
||||||
{
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
hr = Session_EvaluateCondition(pSession, NULL, &myint);
|
ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
|
||||||
ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
|
||||||
|
|
||||||
hr = Session_EvaluateCondition(pSession, szEmpty, &myint);
|
hr = Session_EvaluateCondition(pSession, szEmpty, &myint);
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
|
|
||||||
hr = Session_EvaluateCondition(pSession, szEquals, &myint);
|
hr = Session_EvaluateCondition(pSession, szEquals, &myint);
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
ok(myint == MSICONDITION_ERROR, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
ok(myint == MSICONDITION_ERROR, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
}
|
|
||||||
|
|
||||||
/* Session::DoAction(CostInitialize) must occur before the next statements */
|
/* Session::DoAction(CostInitialize) must occur before the next statements */
|
||||||
hr = Session_DoAction(pSession, szCostInitialize, &myint);
|
hr = Session_DoAction(pSession, szCostInitialize, &myint);
|
||||||
|
@ -1136,17 +1133,14 @@ static void test_Session(IDispatch *pSession)
|
||||||
ok(myint == INSTALLSTATE_UNKNOWN, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
ok(myint == INSTALLSTATE_UNKNOWN, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
|
|
||||||
/* Session::EvaluateCondition */
|
/* Session::EvaluateCondition */
|
||||||
todo_wine
|
hr = Session_EvaluateCondition(pSession, szOneStateFalse, &myint);
|
||||||
{
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
hr = Session_EvaluateCondition(pSession, szOneStateFalse, &myint);
|
if (SUCCEEDED(hr))
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
|
||||||
|
|
||||||
hr = Session_EvaluateCondition(pSession, szOneStateTrue, &myint);
|
hr = Session_EvaluateCondition(pSession, szOneStateTrue, &myint);
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
}
|
|
||||||
|
|
||||||
/* Session::FeatureRequestState, put */
|
/* Session::FeatureRequestState, put */
|
||||||
hr = Session_FeatureRequestStatePut(pSession, szOne, INSTALLSTATE_ADVERTISED);
|
hr = Session_FeatureRequestStatePut(pSession, szOne, INSTALLSTATE_ADVERTISED);
|
||||||
|
@ -1156,17 +1150,14 @@ static void test_Session(IDispatch *pSession)
|
||||||
ok(myint == INSTALLSTATE_ADVERTISED, "Feature request state was %d but expected %d\n", myint, INSTALLSTATE_ADVERTISED);
|
ok(myint == INSTALLSTATE_ADVERTISED, "Feature request state was %d but expected %d\n", myint, INSTALLSTATE_ADVERTISED);
|
||||||
|
|
||||||
/* Session::EvaluateCondition */
|
/* Session::EvaluateCondition */
|
||||||
todo_wine
|
hr = Session_EvaluateCondition(pSession, szOneActionFalse, &myint);
|
||||||
{
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
hr = Session_EvaluateCondition(pSession, szOneActionFalse, &myint);
|
if (SUCCEEDED(hr))
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
|
||||||
|
|
||||||
hr = Session_EvaluateCondition(pSession, szOneActionTrue, &myint);
|
hr = Session_EvaluateCondition(pSession, szOneActionTrue, &myint);
|
||||||
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
ok(SUCCEEDED(hr), "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
|
||||||
ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete key and all its subkeys */
|
/* delete key and all its subkeys */
|
||||||
|
|
Loading…
Reference in New Issue