aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-10-18 14:10:20 -0500
committerSean Hall <r.sean.hall@gmail.com>2020-10-24 20:07:21 -0500
commite879388d96157db6a6e7b2ee79871ef7ebbd3015 (patch)
tree4f3cbf260afa7806e077d75840ec97f276228262
parentbafc4f682a798eb375d32c1f4777664aceb1e15f (diff)
downloadwix-e879388d96157db6a6e7b2ee79871ef7ebbd3015.tar.gz
wix-e879388d96157db6a6e7b2ee79871ef7ebbd3015.tar.bz2
wix-e879388d96157db6a6e7b2ee79871ef7ebbd3015.zip
Add CompareVersions engine method.
-rw-r--r--src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h14
-rw-r--r--src/WixToolset.BootstrapperCore.Native/inc/BundleExtension.h1
-rw-r--r--src/WixToolset.BootstrapperCore.Native/inc/BundleExtensionEngine.h14
-rw-r--r--src/engine/EngineForApplication.cpp19
-rw-r--r--src/engine/EngineForExtension.cpp19
-rw-r--r--src/engine/burnextension.cpp3
-rw-r--r--src/engine/userexperience.cpp2
7 files changed, 70 insertions, 2 deletions
diff --git a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
index a6a87622..13229c29 100644
--- a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
+++ b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperEngine.h
@@ -124,6 +124,7 @@ enum BOOTSTRAPPER_ENGINE_MESSAGE
124 BOOTSTRAPPER_ENGINE_MESSAGE_APPLY, 124 BOOTSTRAPPER_ENGINE_MESSAGE_APPLY,
125 BOOTSTRAPPER_ENGINE_MESSAGE_QUIT, 125 BOOTSTRAPPER_ENGINE_MESSAGE_QUIT,
126 BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE, 126 BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE,
127 BOOTSTRAPPER_ENGINE_MESSAGE_COMPAREVERSIONS,
127}; 128};
128 129
129typedef struct _BAENGINE_APPLY_ARGS 130typedef struct _BAENGINE_APPLY_ARGS
@@ -147,6 +148,19 @@ typedef struct _BAENGINE_CLOSESPLASHSCREEN_RESULTS
147 DWORD cbSize; 148 DWORD cbSize;
148} BAENGINE_CLOSESPLASHSCREEN_RESULTS; 149} BAENGINE_CLOSESPLASHSCREEN_RESULTS;
149 150
151typedef struct _BAENGINE_COMPAREVERSIONS_ARGS
152{
153 DWORD cbSize;
154 LPCWSTR wzVersion1;
155 LPCWSTR wzVersion2;
156} BAENGINE_COMPAREVERSIONS_ARGS;
157
158typedef struct _BAENGINE_COMPAREVERSIONS_RESULTS
159{
160 DWORD cbSize;
161 int nResult;
162} BAENGINE_COMPAREVERSIONS_RESULTS;
163
150typedef struct _BAENGINE_DETECT_ARGS 164typedef struct _BAENGINE_DETECT_ARGS
151{ 165{
152 DWORD cbSize; 166 DWORD cbSize;
diff --git a/src/WixToolset.BootstrapperCore.Native/inc/BundleExtension.h b/src/WixToolset.BootstrapperCore.Native/inc/BundleExtension.h
index 5c7d1260..be76a1a5 100644
--- a/src/WixToolset.BootstrapperCore.Native/inc/BundleExtension.h
+++ b/src/WixToolset.BootstrapperCore.Native/inc/BundleExtension.h
@@ -38,6 +38,7 @@ typedef struct _BUNDLE_EXTENSION_CREATE_ARGS
38 LPVOID pvBundleExtensionEngineProcContext; 38 LPVOID pvBundleExtensionEngineProcContext;
39 LPCWSTR wzBootstrapperWorkingFolder; 39 LPCWSTR wzBootstrapperWorkingFolder;
40 LPCWSTR wzBundleExtensionDataPath; 40 LPCWSTR wzBundleExtensionDataPath;
41 LPCWSTR wzExtensionId;
41} BUNDLE_EXTENSION_CREATE_ARGS; 42} BUNDLE_EXTENSION_CREATE_ARGS;
42 43
43typedef struct _BUNDLE_EXTENSION_CREATE_RESULTS 44typedef struct _BUNDLE_EXTENSION_CREATE_RESULTS
diff --git a/src/WixToolset.BootstrapperCore.Native/inc/BundleExtensionEngine.h b/src/WixToolset.BootstrapperCore.Native/inc/BundleExtensionEngine.h
index adcae1af..becb5be3 100644
--- a/src/WixToolset.BootstrapperCore.Native/inc/BundleExtensionEngine.h
+++ b/src/WixToolset.BootstrapperCore.Native/inc/BundleExtensionEngine.h
@@ -27,8 +27,22 @@ enum BUNDLE_EXTENSION_ENGINE_MESSAGE
27 BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC, 27 BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC,
28 BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLESTRING, 28 BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLESTRING,
29 BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION, 29 BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION,
30 BUNDLE_EXTENSION_ENGINE_MESSAGE_COMPAREVERSIONS,
30}; 31};
31 32
33typedef struct _BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS
34{
35 DWORD cbSize;
36 LPCWSTR wzVersion1;
37 LPCWSTR wzVersion2;
38} BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS;
39
40typedef struct _BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS
41{
42 DWORD cbSize;
43 int nResult;
44} BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS;
45
32typedef struct _BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_ARGS 46typedef struct _BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_ARGS
33{ 47{
34 DWORD cbSize; 48 DWORD cbSize;
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
619static 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
619static HRESULT BAEngineDetect( 635static 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
294static 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
294HRESULT WINAPI EngineForExtensionProc( 310HRESULT 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