Allow BA to update feed source
Fixes wixtoolset/issues#5568
Rob Mensching committed
Apr 14, 2021 at 12:18 UTC
6c740c1070475a8a894393a186cdcdd8a8a81112
5 files changed
+39
src/WixToolset.Mba.Core/Engine.cs
+6
@@ -246,6 +246,12 @@ namespace WixToolset.Mba.Core
246
this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, null == hash ? 0 : hash.Length);
247
}
248
249
+ /// <inheritdoc/>
250
+ public void SetUpdateSource(string url)
251
+ {
252
+ this.engine.SetUpdateSource(url);
253
+ }
254
+
255
/// <inheritdoc/>
256
public void SetLocalSource(string packageOrContainerId, string payloadId, string path)
257
{
src/WixToolset.Mba.Core/IBootstrapperEngine.cs
+8
@@ -277,6 +277,14 @@ namespace WixToolset.Mba.Core
277
[MarshalAs(UnmanagedType.U4)] int dwWaitForInputIdleTimeout
278
);
279
280
+ /// <summary>
281
+ /// Sets the URL to the update feed.
282
+ /// </summary>
283
+ /// <param name="url">URL of the update feed.</param>
284
+ void SetUpdateSource(
285
+ [MarshalAs(UnmanagedType.LPWStr)] string url
286
+ );
287
+
288
/// <summary>
289
/// See <see cref="IEngine.CompareVersions(string, string)"/>.
290
/// </summary>
src/WixToolset.Mba.Core/IEngine.cs
+6
@@ -144,6 +144,12 @@ namespace WixToolset.Mba.Core
144
/// <param name="hash">Optional hash expected for the update.</param>
145
void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash);
146
147
+ /// <summary>
148
+ /// Sets the URL to the update feed.
149
+ /// </summary>
150
+ /// <param name="url">URL of the update feed.</param>
151
+ void SetUpdateSource(string url);
152
+
153
/// <summary>
154
/// Set the local source for a package or container.
155
/// </summary>
src/balutil/BalBootstrapperEngine.cpp
+15
@@ -535,6 +535,21 @@ public: // IBootstrapperEngine
535
return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_LAUNCHAPPROVEDEXE, &args, &results, m_pvBAEngineProcContext);
536
}
537
538
+ virtual STDMETHODIMP SetUpdateSource(
539
+ __in_z LPCWSTR wzUrl
540
+ )
541
+ {
542
+ BAENGINE_SETUPDATESOURCE_ARGS args = { };
543
+ BAENGINE_SETUPDATESOURCE_RESULTS results = { };
544
+
545
+ args.cbSize = sizeof(args);
546
+ args.wzUrl = wzUrl;
547
+
548
+ results.cbSize = sizeof(results);
549
+
550
+ return m_pfnBAEngineProc(BOOTSTRAPPER_ENGINE_MESSAGE_SETUPDATESOURCE, &args, &results, m_pvBAEngineProcContext);
551
+ }
552
+
553
virtual STDMETHODIMP CompareVersions(
554
__in_z LPCWSTR wzVersion1,
555
__in_z LPCWSTR wzVersion2,
src/balutil/inc/IBootstrapperEngine.h
+4
@@ -128,6 +128,10 @@ DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-8
128
__in DWORD dwWaitForInputIdleTimeout
129
) = 0;
130
131
+ STDMETHOD(SetUpdateSource)(
132
+ __in_z LPCWSTR wzUrl
133
+ ) = 0;
134
+
135
STDMETHOD(CompareVersions)(
136
__in_z LPCWSTR wzVersion1,
137
__in_z LPCWSTR wzVersion2,