From e879388d96157db6a6e7b2ee79871ef7ebbd3015 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 18 Oct 2020 14:10:20 -0500 Subject: Add CompareVersions engine method. --- src/engine/EngineForApplication.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/engine/EngineForApplication.cpp') diff --git a/src/engine/EngineForApplication.cpp b/src/engine/EngineForApplication.cpp index d034c2bf..49ffe700 100644 --- a/src/engine/EngineForApplication.cpp +++ b/src/engine/EngineForApplication.cpp @@ -616,6 +616,22 @@ static HRESULT BAEngineCloseSplashScreen( return S_OK; } +static HRESULT BAEngineCompareVersions( + __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, + __in const BAENGINE_COMPAREVERSIONS_ARGS* pArgs, + __in BAENGINE_COMPAREVERSIONS_RESULTS* pResults + ) +{ + HRESULT hr = S_OK; + LPCWSTR wzVersion1 = pArgs->wzVersion1; + LPCWSTR wzVersion2 = pArgs->wzVersion2; + int* pnResult = &pResults->nResult; + + hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); + + return hr; +} + static HRESULT BAEngineDetect( __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, __in BAENGINE_DETECT_ARGS* pArgs, @@ -861,6 +877,9 @@ HRESULT WINAPI EngineForApplicationProc( case BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE: hr = BAEngineLaunchApprovedExe(pContext, reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); break; + case BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS: + hr = BAEngineCompareVersions(pContext, reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); + break; default: hr = E_NOTIMPL; break; -- cgit v1.2.3-55-g6feb