diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-10-18 14:10:20 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-10-24 20:07:21 -0500 |
| commit | e879388d96157db6a6e7b2ee79871ef7ebbd3015 (patch) | |
| tree | 4f3cbf260afa7806e077d75840ec97f276228262 /src/engine | |
| parent | bafc4f682a798eb375d32c1f4777664aceb1e15f (diff) | |
| download | wix-e879388d96157db6a6e7b2ee79871ef7ebbd3015.tar.gz wix-e879388d96157db6a6e7b2ee79871ef7ebbd3015.tar.bz2 wix-e879388d96157db6a6e7b2ee79871ef7ebbd3015.zip | |
Add CompareVersions engine method.
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/EngineForApplication.cpp | 19 | ||||
| -rw-r--r-- | src/engine/EngineForExtension.cpp | 19 | ||||
| -rw-r--r-- | src/engine/burnextension.cpp | 3 | ||||
| -rw-r--r-- | src/engine/userexperience.cpp | 2 |
4 files changed, 41 insertions, 2 deletions
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( | |||
| 616 | return S_OK; | 616 | return S_OK; |
| 617 | } | 617 | } |
| 618 | 618 | ||
| 619 | static HRESULT BAEngineCompareVersions( | ||
| 620 | __in BOOTSTRAPPER_ENGINE_CONTEXT* /*pContext*/, | ||
| 621 | __in const BAENGINE_COMPAREVERSIONS_ARGS* pArgs, | ||
| 622 | __in BAENGINE_COMPAREVERSIONS_RESULTS* pResults | ||
| 623 | ) | ||
| 624 | { | ||
| 625 | HRESULT hr = S_OK; | ||
| 626 | LPCWSTR wzVersion1 = pArgs->wzVersion1; | ||
| 627 | LPCWSTR wzVersion2 = pArgs->wzVersion2; | ||
| 628 | int* pnResult = &pResults->nResult; | ||
| 629 | |||
| 630 | hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); | ||
| 631 | |||
| 632 | return hr; | ||
| 633 | } | ||
| 634 | |||
| 619 | static HRESULT BAEngineDetect( | 635 | static HRESULT BAEngineDetect( |
| 620 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, | 636 | __in BOOTSTRAPPER_ENGINE_CONTEXT* pContext, |
| 621 | __in BAENGINE_DETECT_ARGS* pArgs, | 637 | __in BAENGINE_DETECT_ARGS* pArgs, |
| @@ -861,6 +877,9 @@ HRESULT WINAPI EngineForApplicationProc( | |||
| 861 | case BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE: | 877 | case BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE: |
| 862 | hr = BAEngineLaunchApprovedExe(pContext, reinterpret_cast<BAENGINE_LAUNCHAPPROVEDEXE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_LAUNCHAPPROVEDEXE_RESULTS*>(pvResults)); | 878 | hr = BAEngineLaunchApprovedExe(pContext, reinterpret_cast<BAENGINE_LAUNCHAPPROVEDEXE_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_LAUNCHAPPROVEDEXE_RESULTS*>(pvResults)); |
| 863 | break; | 879 | break; |
| 880 | case BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS: | ||
| 881 | hr = BAEngineCompareVersions(pContext, reinterpret_cast<BAENGINE_COMPAREVERSIONS_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_COMPAREVERSIONS_RESULTS*>(pvResults)); | ||
| 882 | break; | ||
| 864 | default: | 883 | default: |
| 865 | hr = E_NOTIMPL; | 884 | hr = E_NOTIMPL; |
| 866 | break; | 885 | break; |
diff --git a/src/engine/EngineForExtension.cpp b/src/engine/EngineForExtension.cpp index 6ec80a0f..c165e2c2 100644 --- a/src/engine/EngineForExtension.cpp +++ b/src/engine/EngineForExtension.cpp | |||
| @@ -291,6 +291,22 @@ LExit: | |||
| 291 | return hr; | 291 | return hr; |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | static HRESULT BEEngineCompareVersions( | ||
| 295 | __in BURN_EXTENSION_ENGINE_CONTEXT* /*pContext*/, | ||
| 296 | __in const BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS* pArgs, | ||
| 297 | __in BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS* pResults | ||
| 298 | ) | ||
| 299 | { | ||
| 300 | HRESULT hr = S_OK; | ||
| 301 | LPCWSTR wzVersion1 = pArgs->wzVersion1; | ||
| 302 | LPCWSTR wzVersion2 = pArgs->wzVersion2; | ||
| 303 | int* pnResult = &pResults->nResult; | ||
| 304 | |||
| 305 | hr = VerCompareStringVersions(wzVersion1, wzVersion2, FALSE, pnResult); | ||
| 306 | |||
| 307 | return hr; | ||
| 308 | } | ||
| 309 | |||
| 294 | HRESULT WINAPI EngineForExtensionProc( | 310 | HRESULT WINAPI EngineForExtensionProc( |
| 295 | __in BUNDLE_EXTENSION_ENGINE_MESSAGE message, | 311 | __in BUNDLE_EXTENSION_ENGINE_MESSAGE message, |
| 296 | __in const LPVOID pvArgs, | 312 | __in const LPVOID pvArgs, |
| @@ -338,6 +354,9 @@ HRESULT WINAPI EngineForExtensionProc( | |||
| 338 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION: | 354 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION: |
| 339 | hr = BEEngineSetVariableVersion(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS*>(pvResults)); | 355 | hr = BEEngineSetVariableVersion(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS*>(pvResults)); |
| 340 | break; | 356 | break; |
| 357 | case BUNDLE_EXTENSION_ENGINE_MESSAGE_COMPAREVERSIONS: | ||
| 358 | hr = BEEngineCompareVersions(pContext, reinterpret_cast<BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS*>(pvArgs), reinterpret_cast<BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS*>(pvResults)); | ||
| 359 | break; | ||
| 341 | default: | 360 | default: |
| 342 | hr = E_NOTIMPL; | 361 | hr = E_NOTIMPL; |
| 343 | break; | 362 | break; |
diff --git a/src/engine/burnextension.cpp b/src/engine/burnextension.cpp index 59f84eca..157b082f 100644 --- a/src/engine/burnextension.cpp +++ b/src/engine/burnextension.cpp | |||
| @@ -126,9 +126,10 @@ EXTERN_C HRESULT BurnExtensionLoad( | |||
| 126 | args.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_ARGS); | 126 | args.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_ARGS); |
| 127 | args.pfnBundleExtensionEngineProc = EngineForExtensionProc; | 127 | args.pfnBundleExtensionEngineProc = EngineForExtensionProc; |
| 128 | args.pvBundleExtensionEngineProcContext = pEngineContext; | 128 | args.pvBundleExtensionEngineProcContext = pEngineContext; |
| 129 | args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 1); // TODO: need to decide whether to keep this, and if so when to update it. | 129 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 8, 31, 0); |
| 130 | args.wzBootstrapperWorkingFolder = pEngineContext->pEngineState->userExperience.sczTempDirectory; | 130 | args.wzBootstrapperWorkingFolder = pEngineContext->pEngineState->userExperience.sczTempDirectory; |
| 131 | args.wzBundleExtensionDataPath = sczBundleExtensionDataPath; | 131 | args.wzBundleExtensionDataPath = sczBundleExtensionDataPath; |
| 132 | args.wzExtensionId = pExtension->sczId; | ||
| 132 | 133 | ||
| 133 | results.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_RESULTS); | 134 | results.cbSize = sizeof(BUNDLE_EXTENSION_CREATE_RESULTS); |
| 134 | 135 | ||
diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 6ab28cde..5f18cdbc 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp | |||
| @@ -97,7 +97,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
| 97 | args.pCommand = pCommand; | 97 | args.pCommand = pCommand; |
| 98 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 98 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
| 99 | args.pvBootstrapperEngineProcContext = pEngineContext; | 99 | args.pvBootstrapperEngineProcContext = pEngineContext; |
| 100 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 5, 14, 0); | 100 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 8, 31, 0); |
| 101 | 101 | ||
| 102 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 102 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
| 103 | 103 | ||
