diff --git a/src/Setup/Bundle/Bundle.wixproj b/src/Setup/Bundle/Bundle.wixproj
index 0ae1edf5..25c2fd67 100644
--- a/src/Setup/Bundle/Bundle.wixproj
+++ b/src/Setup/Bundle/Bundle.wixproj
@@ -45,7 +45,7 @@
VisualStudioTargetVersion=2015
-
+
diff --git a/src/Setup/WixBA/UpdateViewModel.cs b/src/Setup/WixBA/UpdateViewModel.cs
index 567653bb..f1d38c5d 100644
--- a/src/Setup/WixBA/UpdateViewModel.cs
+++ b/src/Setup/WixBA/UpdateViewModel.cs
@@ -160,7 +160,7 @@ namespace WixToolset.UX
if ((UpdateState.Failed != this.State) && (LaunchAction.Uninstall != WixBA.Model.Command.Action) && (Display.Full == WixBA.Model.Command.Display))
{
this.State = UpdateState.Checking;
- e.Result = Result.Ok;
+ e.Skip = false;
}
}
@@ -168,7 +168,7 @@ namespace WixToolset.UX
{
// The list of updates is sorted in descending version, so the first callback should be the largest update available.
// This update should be either larger than ours (so we are out of date), the same as ours (so we are current)
- // or smaller than ours (we have a private build). If we really wanted to, we could leave the e.Result alone and
+ // or smaller than ours (we have a private build). If we really wanted to, we could leave the e.StopProcessingUpdates alone and
// enumerate all of the updates.
WixBA.Model.Engine.Log(LogLevel.Verbose, String.Format("Potential update v{0} from '{1}'; current version: v{2}", e.Version, e.UpdateLocation, WixBA.Model.Version));
if (e.Version > WixBA.Model.Version)
@@ -178,13 +178,12 @@ namespace WixToolset.UX
string changesFormat = @"{0}";
this.UpdateChanges = String.Format(changesFormat, e.Content);
this.State = UpdateState.Available;
- e.Result = Result.Ok;
}
- else if (e.Version <= WixBA.Model.Version)
+ else
{
this.State = UpdateState.Current;
- e.Result = Result.Cancel;
}
+ e.StopProcessingUpdates = true;
}
private void DetectUpdateComplete(object sender, Bootstrapper.DetectUpdateCompleteEventArgs e)
diff --git a/src/burn/engine/detect.cpp b/src/burn/engine/detect.cpp
index 7a74f88a..7bfef860 100644
--- a/src/burn/engine/detect.cpp
+++ b/src/burn/engine/detect.cpp
@@ -390,11 +390,10 @@ static HRESULT DetectAtomFeedUpdate(
HRESULT hr = S_OK;
- int nResult = IDNOACTION;
LPWSTR sczUpdateFeedTempFile = NULL;
-
ATOM_FEED* pAtomFeed = NULL;
APPLICATION_UPDATE_CHAIN* pApupChain = NULL;
+ BOOL fStopProcessingUpdates = FALSE;
hr = AtomInitialize();
ExitOnFailure(hr, "Failed to initialize Atom.");
@@ -414,27 +413,16 @@ static HRESULT DetectAtomFeedUpdate(
{
APPLICATION_UPDATE_ENTRY* pAppUpdateEntry = &pApupChain->rgEntries[i];
- nResult = pUX->pUserExperience->OnDetectUpdate(pAppUpdateEntry->rgEnclosures ? pAppUpdateEntry->rgEnclosures->wzUrl : NULL,
+ hr = UserExperienceOnDetectUpdate(pUX, pAppUpdateEntry->rgEnclosures ? pAppUpdateEntry->rgEnclosures->wzUrl : NULL,
pAppUpdateEntry->rgEnclosures ? pAppUpdateEntry->rgEnclosures->dw64Size : 0,
pAppUpdateEntry->dw64Version, pAppUpdateEntry->wzTitle,
- pAppUpdateEntry->wzSummary, pAppUpdateEntry->wzContentType, pAppUpdateEntry->wzContent, IDNOACTION);
+ pAppUpdateEntry->wzSummary, pAppUpdateEntry->wzContentType, pAppUpdateEntry->wzContent, &fStopProcessingUpdates);
+ ExitOnRootFailure(hr, "BA aborted detect update.");
- switch (nResult)
+ if (fStopProcessingUpdates)
{
- case IDNOACTION:
- hr = S_OK;
- continue;
- case IDOK:
- pUpdate->fUpdateAvailable = TRUE;
- hr = S_OK;
- break;
- case IDCANCEL:
- hr = S_FALSE;
- break;
- default:
- ExitOnRootFailure(hr = E_INVALIDDATA, "UX aborted detect update begin.");
+ break;
}
- break;
}
}
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp
index 316c41e2..d4bc1318 100644
--- a/src/burn/engine/userexperience.cpp
+++ b/src/burn/engine/userexperience.cpp
@@ -374,6 +374,47 @@ LExit:
return hr;
}
+BAAPI UserExperienceOnDetectUpdate(
+ __in BURN_USER_EXPERIENCE* pUserExperience,
+ __in_z LPCWSTR wzUpdateLocation,
+ __in DWORD64 dw64Size,
+ __in DWORD64 dw64Version,
+ __in_z_opt LPCWSTR wzTitle,
+ __in_z_opt LPCWSTR wzSummary,
+ __in_z_opt LPCWSTR wzContentType,
+ __in_z_opt LPCWSTR wzContent,
+ __inout BOOL* pfStopProcessingUpdates
+ )
+{
+ HRESULT hr = S_OK;
+ BA_ONDETECTUPDATE_ARGS args = { };
+ BA_ONDETECTUPDATE_RESULTS results = { };
+
+ args.cbSize = sizeof(args);
+ args.wzUpdateLocation = wzUpdateLocation;
+ args.dw64Size = dw64Size;
+ args.dw64Version = dw64Version;
+ args.wzTitle = wzTitle;
+ args.wzSummary = wzSummary;
+ args.wzContentType = wzContentType;
+ args.wzContent = wzContent;
+
+ results.cbSize = sizeof(results);
+ results.fStopProcessingUpdates = *pfStopProcessingUpdates;
+
+ hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE, &args, &results, pUserExperience->pvBAProcContext);
+ ExitOnFailure(hr, "BA OnDetectUpdate failed.");
+
+ if (results.fCancel)
+ {
+ hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
+ }
+ *pfStopProcessingUpdates = results.fStopProcessingUpdates;
+
+LExit:
+ return hr;
+}
+
BAAPI UserExperienceOnDetectUpdateBegin(
__in BURN_USER_EXPERIENCE* pUserExperience,
__in_z LPCWSTR wzUpdateLocation,
diff --git a/src/burn/engine/userexperience.h b/src/burn/engine/userexperience.h
index 75973f04..423b8325 100644
--- a/src/burn/engine/userexperience.h
+++ b/src/burn/engine/userexperience.h
@@ -116,6 +116,17 @@ HRESULT UserExperienceOnDetectForwardCompatibleBundle(
__in DWORD64 dw64Version,
__inout BOOL* pfIgnoreBundle
);
+HRESULT UserExperienceOnDetectUpdate(
+ __in BURN_USER_EXPERIENCE* pUserExperience,
+ __in_z LPCWSTR wzUpdateLocation,
+ __in DWORD64 dw64Size,
+ __in DWORD64 dw64Version,
+ __in_z_opt LPCWSTR wzTitle,
+ __in_z_opt LPCWSTR wzSummary,
+ __in_z_opt LPCWSTR wzContentType,
+ __in_z_opt LPCWSTR wzContent,
+ __inout BOOL* pfStopProcessingUpdates
+ );
HRESULT UserExperienceOnDetectUpdateBegin(
__in BURN_USER_EXPERIENCE* pUserExperience,
__in_z LPCWSTR wzUpdateLocation,
diff --git a/src/burn/inc/BootstrapperApplication.h b/src/burn/inc/BootstrapperApplication.h
index 51e64e26..0c110b75 100644
--- a/src/burn/inc/BootstrapperApplication.h
+++ b/src/burn/inc/BootstrapperApplication.h
@@ -88,6 +88,7 @@ enum BOOTSTRAPPER_APPLICATION_MESSAGE
BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMSHUTDOWN,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE,
BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN,
+ BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE,
};
enum BOOTSTRAPPER_SHUTDOWN_ACTION
@@ -163,6 +164,25 @@ struct BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS
BOOL fIgnoreBundle;
};
+struct BA_ONDETECTUPDATE_ARGS
+{
+ DWORD cbSize;
+ LPCWSTR wzUpdateLocation;
+ DWORD64 dw64Size;
+ DWORD64 dw64Version;
+ LPCWSTR wzTitle;
+ LPCWSTR wzSummary;
+ LPCWSTR wzContentType;
+ LPCWSTR wzContent;
+};
+
+struct BA_ONDETECTUPDATE_RESULTS
+{
+ DWORD cbSize;
+ BOOL fCancel;
+ BOOL fStopProcessingUpdates;
+};
+
struct BA_ONDETECTUPDATEBEGIN_ARGS
{
DWORD cbSize;
diff --git a/src/burn/inc/IBootstrapperApplication.h b/src/burn/inc/IBootstrapperApplication.h
index e4d2393f..29b83144 100644
--- a/src/burn/inc/IBootstrapperApplication.h
+++ b/src/burn/inc/IBootstrapperApplication.h
@@ -45,14 +45,7 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
) = 0;
// OnDetectUpdate - called when the engine has an update candidate for bundle update.
- //
- // Return:
- // IDOK instructs the engine to stop further update detection.
- //
- // IDCANCEL instructs the engine to stop detection.
- //
- // IDNOACTION instructs the engine to process further update candidates.
- STDMETHOD_(int, OnDetectUpdate)(
+ STDMETHOD(OnDetectUpdate)(
__in_z_opt LPCWSTR wzUpdateLocation,
__in DWORD64 dw64Size,
__in DWORD64 dw64Version,
@@ -60,7 +53,8 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A
__in_z_opt LPCWSTR wzSummary,
__in_z_opt LPCWSTR wzContentType,
__in_z_opt LPCWSTR wzContent,
- __in int nRecommendation
+ __inout BOOL* pfCancel,
+ __inout BOOL* pfStopProcessingUpdates
) = 0;
// OnDetectUpdateComplete - called when the engine completes detection for bundle update.
diff --git a/src/ext/BalExtension/mba/core/BootstrapperApplication.cs b/src/ext/BalExtension/mba/core/BootstrapperApplication.cs
index 863fca2d..49559564 100644
--- a/src/ext/BalExtension/mba/core/BootstrapperApplication.cs
+++ b/src/ext/BalExtension/mba/core/BootstrapperApplication.cs
@@ -1141,12 +1141,14 @@ namespace WixToolset.Bootstrapper
return args.HResult;
}
- Result IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, long dw64Version, string wzTitle, string wzSummary, string wzContentType, string wzContent, int nRecommendation)
+ int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, long dw64Version, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates)
{
- DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, dw64Version, wzTitle, wzSummary, wzContentType, wzContent, nRecommendation);
+ DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, dw64Version, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates);
this.OnDetectUpdate(args);
- return args.Result;
+ fCancel = args.Cancel;
+ fStopProcessingUpdates = args.StopProcessingUpdates;
+ return args.HResult;
}
Result IBootstrapperApplication.OnDetectUpdateComplete(int hrStatus, string wzUpdateLocation, int nRecommendation)
diff --git a/src/ext/BalExtension/mba/core/EventArgs.cs b/src/ext/BalExtension/mba/core/EventArgs.cs
index ad78a450..1c516987 100644
--- a/src/ext/BalExtension/mba/core/EventArgs.cs
+++ b/src/ext/BalExtension/mba/core/EventArgs.cs
@@ -334,15 +334,8 @@ namespace WixToolset.Bootstrapper
/// Additional arguments used when the detection for an update has begun.
///
[Serializable]
- public class DetectUpdateEventArgs : ResultEventArgs
+ public class DetectUpdateEventArgs : CancellableHResultEventArgs
{
- private long size;
- private Version version;
- private string title;
- private string summary;
- private string contentType;
- private string content;
-
///
/// Creates a new instance of the class.
///
@@ -353,17 +346,19 @@ namespace WixToolset.Bootstrapper
/// The summary of the updated bundle.
/// The content type of the content of the updated bundle.
/// The content of the updated bundle.
- /// The recommendation from the engine.
- public DetectUpdateEventArgs(string updateLocation, long size, long version, string title, string summary, string contentType, string content, int recommendation)
- : base(recommendation)
+ /// The recommendation from the engine.
+ /// The recommendation from the engine.
+ public DetectUpdateEventArgs(string updateLocation, long size, long version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation)
+ : base(cancelRecommendation)
{
this.UpdateLocation = updateLocation;
- this.size = size;
- this.version = new Version((int)(version >> 48 & 0xFFFF), (int)(version >> 32 & 0xFFFF), (int)(version >> 16 & 0xFFFF), (int)(version & 0xFFFF));
- this.title = title;
- this.summary = summary;
- this.contentType = contentType;
- this.content = content;
+ this.Size = size;
+ this.Version = Engine.LongToVersion(version);
+ this.Title = title;
+ this.Summary = summary;
+ this.ContentType = contentType;
+ this.Content = content;
+ this.StopProcessingUpdates = stopRecommendation;
}
///
@@ -374,50 +369,37 @@ namespace WixToolset.Bootstrapper
///
/// Gets the size of the updated bundle.
///
- public long Size
- {
- get { return this.size; }
- }
+ public long Size { get; private set; }
///
/// Gets the version of the updated bundle.
///
- public Version Version
- {
- get { return this.version; }
- }
+ public Version Version { get; private set; }
///
/// Gets the title of the the updated bundle.
///
- public string Title
- {
- get { return this.title; }
- }
+ public string Title { get; private set; }
///
/// Gets the summary of the updated bundle.
///
- public string Summary
- {
- get { return this.summary; }
- }
+ public string Summary { get; private set; }
///
/// Gets the content type of the content of the updated bundle.
///
- public string ContentType
- {
- get { return this.contentType; }
- }
+ public string ContentType { get; private set; }
///
/// Gets the content of the updated bundle.
///
- public string Content
- {
- get { return this.content; }
- }
+ public string Content { get; private set; }
+
+ ///
+ /// Tells the engine to stop giving the rest of the updates found in the feed.
+ ///
+ public bool StopProcessingUpdates { get; set; }
}
///
diff --git a/src/ext/BalExtension/mba/core/IBootstrapperApplication.cs b/src/ext/BalExtension/mba/core/IBootstrapperApplication.cs
index 16736a10..ca3abb49 100644
--- a/src/ext/BalExtension/mba/core/IBootstrapperApplication.cs
+++ b/src/ext/BalExtension/mba/core/IBootstrapperApplication.cs
@@ -60,7 +60,7 @@ namespace WixToolset.Bootstrapper
[PreserveSig]
[return: MarshalAs(UnmanagedType.I4)]
- Result OnDetectUpdate(
+ int OnDetectUpdate(
[MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation,
[MarshalAs(UnmanagedType.U8)] long dw64Size,
[MarshalAs(UnmanagedType.U8)] long dw64Version,
@@ -68,7 +68,8 @@ namespace WixToolset.Bootstrapper
[MarshalAs(UnmanagedType.LPWStr)] string wzSummary,
[MarshalAs(UnmanagedType.LPWStr)] string wzContentType,
[MarshalAs(UnmanagedType.LPWStr)] string wzContent,
- [MarshalAs(UnmanagedType.I4)] int nRecommendation
+ [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
+ [MarshalAs(UnmanagedType.Bool)] ref bool fStopProcessingUpdates
);
[PreserveSig]
diff --git a/src/ext/BalExtension/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/BalExtension/wixstdba/WixStandardBootstrapperApplication.cpp
index d806d97d..dcd9cd90 100644
--- a/src/ext/BalExtension/wixstdba/WixStandardBootstrapperApplication.cpp
+++ b/src/ext/BalExtension/wixstdba/WixStandardBootstrapperApplication.cpp
@@ -945,6 +945,9 @@ public: // IBootstrapperApplication
case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN:
OnDetectUpdateBeginFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
break;
+ case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE:
+ OnDetectUpdateFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
default:
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Forwarding unknown BA message: %d", message);
m_pfnBAFunctionsProc((BA_FUNCTIONS_MESSAGE)message, pvArgs, pvResults, m_pvBAFunctionsProcContext);
@@ -1012,6 +1015,13 @@ private: // privates
m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
}
+ void OnDetectUpdateFallback(
+ __in BA_ONDETECTUPDATE_ARGS* pArgs,
+ __inout BA_ONDETECTUPDATE_RESULTS* pResults)
+ {
+ m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE, pArgs, pResults, m_pvBAFunctionsProcContext);
+ }
+
//
// UiThreadProc - entrypoint for UI thread.
//
diff --git a/src/libs/balutil/inc/BAFunctions.h b/src/libs/balutil/inc/BAFunctions.h
index 5fd01ae4..57e2d5cd 100644
--- a/src/libs/balutil/inc/BAFunctions.h
+++ b/src/libs/balutil/inc/BAFunctions.h
@@ -18,6 +18,7 @@ enum BA_FUNCTIONS_MESSAGE
BA_FUNCTIONS_MESSAGE_ONSYSTEMSHUTDOWN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMSHUTDOWN,
BA_FUNCTIONS_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE,
BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN,
+ BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE,
BA_FUNCTIONS_MESSAGE_ONTHEMELOADED = 1024,
};
diff --git a/src/libs/balutil/inc/BalBaseBAFunctions.h b/src/libs/balutil/inc/BalBaseBAFunctions.h
index 870baf78..5d87ac15 100644
--- a/src/libs/balutil/inc/BalBaseBAFunctions.h
+++ b/src/libs/balutil/inc/BalBaseBAFunctions.h
@@ -120,7 +120,7 @@ public: // IBootstrapperApplication
return S_OK;
}
- virtual STDMETHODIMP_(int) OnDetectUpdate(
+ virtual STDMETHODIMP OnDetectUpdate(
__in_z LPCWSTR /*wzUpdateLocation*/,
__in DWORD64 /*dw64Size*/,
__in DWORD64 /*dw64Version*/,
@@ -128,10 +128,11 @@ public: // IBootstrapperApplication
__in_z LPCWSTR /*wzSummary*/,
__in_z LPCWSTR /*wzContentType*/,
__in_z LPCWSTR /*wzContent*/,
- __in int nRecommendation
+ __inout BOOL* /*pfCancel*/,
+ __inout BOOL* /*pfStopProcessingUpdates*/
)
{
- return nRecommendation;
+ return S_OK;
}
virtual STDMETHODIMP_(int) OnDetectUpdateComplete(
diff --git a/src/libs/balutil/inc/BalBaseBAFunctionsProc.h b/src/libs/balutil/inc/BalBaseBAFunctionsProc.h
index 5228d2e5..100bc2d2 100644
--- a/src/libs/balutil/inc/BalBaseBAFunctionsProc.h
+++ b/src/libs/balutil/inc/BalBaseBAFunctionsProc.h
@@ -44,6 +44,7 @@ static HRESULT WINAPI BalBaseBAFunctionsProc(
case BA_FUNCTIONS_MESSAGE_ONSYSTEMSHUTDOWN:
case BA_FUNCTIONS_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE:
case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN:
+ case BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE:
hr = BalBaseBootstrapperApplicationProc((BOOTSTRAPPER_APPLICATION_MESSAGE)message, pvArgs, pvResults, pvContext);
break;
case BA_FUNCTIONS_MESSAGE_ONTHEMELOADED:
diff --git a/src/libs/balutil/inc/BalBaseBootstrapperApplication.h b/src/libs/balutil/inc/BalBaseBootstrapperApplication.h
index ed4d6af6..cd390a20 100644
--- a/src/libs/balutil/inc/BalBaseBootstrapperApplication.h
+++ b/src/libs/balutil/inc/BalBaseBootstrapperApplication.h
@@ -120,7 +120,7 @@ public: // IBootstrapperApplication
return S_OK;
}
- virtual STDMETHODIMP_(int) OnDetectUpdate(
+ virtual STDMETHODIMP OnDetectUpdate(
__in_z LPCWSTR /*wzUpdateLocation*/,
__in DWORD64 /*dw64Size*/,
__in DWORD64 /*dw64Version*/,
@@ -128,10 +128,12 @@ public: // IBootstrapperApplication
__in_z LPCWSTR /*wzSummary*/,
__in_z LPCWSTR /*wzContentType*/,
__in_z LPCWSTR /*wzContent*/,
- __in int nRecommendation
+ __inout BOOL* pfCancel,
+ __inout BOOL* /*pfStopProcessingUpdates*/
)
{
- return CheckCanceled() ? IDCANCEL : nRecommendation;
+ *pfCancel |= CheckCanceled();
+ return S_OK;
}
virtual STDMETHODIMP_(int) OnDetectUpdateComplete(
diff --git a/src/libs/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/libs/balutil/inc/BalBaseBootstrapperApplicationProc.h
index 45885647..c35ddf1c 100644
--- a/src/libs/balutil/inc/BalBaseBootstrapperApplicationProc.h
+++ b/src/libs/balutil/inc/BalBaseBootstrapperApplicationProc.h
@@ -90,6 +90,15 @@ static HRESULT BalBaseBAProcOnDetectUpdateBegin(
return pBA->OnDetectUpdateBegin(pArgs->wzUpdateLocation, &pResults->fCancel, &pResults->fSkip);
}
+static HRESULT BalBaseBAProcOnDetectUpdate(
+ __in IBootstrapperApplication* pBA,
+ __in BA_ONDETECTUPDATE_ARGS* pArgs,
+ __inout BA_ONDETECTUPDATE_RESULTS* pResults
+ )
+{
+ return pBA->OnDetectUpdate(pArgs->wzUpdateLocation, pArgs->dw64Size, pArgs->dw64Version, pArgs->wzTitle, pArgs->wzSummary, pArgs->wzContentType, pArgs->wzContent, &pResults->fCancel, &pResults->fStopProcessingUpdates);
+}
+
/*******************************************************************
BalBaseBootstrapperApplicationProc - requires pvContext to be of type IBootstrapperApplication.
Provides a default mapping between the new message based BA interface and
@@ -137,6 +146,9 @@ static HRESULT WINAPI BalBaseBootstrapperApplicationProc(
case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN:
hr = BalBaseBAProcOnDetectUpdateBegin(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
break;
+ case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE:
+ hr = BalBaseBAProcOnDetectUpdate(pBA, reinterpret_cast(pvArgs), reinterpret_cast(pvResults));
+ break;
}
}
diff --git a/test/src/Utilities/TestBA/TestBA.cs b/test/src/Utilities/TestBA/TestBA.cs
index 053ddafa..ebed3162 100644
--- a/test/src/Utilities/TestBA/TestBA.cs
+++ b/test/src/Utilities/TestBA/TestBA.cs
@@ -123,7 +123,7 @@ namespace WixTest.BA
{
// The list of updates is sorted in descending version, so the first callback should be the largest update available.
// This update should be either larger than ours (so we are out of date), the same as ours (so we are current)
- // or smaller than ours (we have a private build). If we really wanted to, we could leave the e.Result alone and
+ // or smaller than ours (we have a private build). If we really wanted to, we could leave the e.StopProcessingUpdates alone and
// enumerate all of the updates.
this.Log(String.Format("Potential update v{0} from '{1}'; current version: v{2}", e.Version, e.UpdateLocation, this.Version));
if (e.Version > this.Version)
@@ -131,13 +131,12 @@ namespace WixTest.BA
this.Log(String.Format("Selected update v{0}", e.Version));
this.Engine.SetUpdate(null, e.UpdateLocation, e.Size, UpdateHashType.None, null);
this.UpdateAvailable = true;
- e.Result = Result.Ok;
}
- else if (e.Version <= this.Version)
+ else
{
- e.Result = Result.Cancel;
this.UpdateAvailable = false;
}
+ e.StopProcessingUpdates = true;
}
protected override void OnDetectUpdateComplete(DetectUpdateCompleteEventArgs e)