Update WixBA to Mba.Core 4.0.58.
Sean Hall committed
May 5, 2021 at 21:01 UTC
3c88529e8e29f9763a6830f8d3ac29cd56a4cb33
3 files changed
+58
-12
src/WixToolset.WixBA/InstallationViewModel.cs
+24
-11
@@ -79,11 +79,11 @@ namespace WixToolset.WixBA
79
WixBA.Model.Bootstrapper.PlanComplete += this.PlanComplete;
80
WixBA.Model.Bootstrapper.ApplyBegin += this.ApplyBegin;
81
WixBA.Model.Bootstrapper.CacheAcquireBegin += this.CacheAcquireBegin;
82
+ WixBA.Model.Bootstrapper.CacheAcquireResolving += this.CacheAcquireResolving;
83
WixBA.Model.Bootstrapper.CacheAcquireComplete += this.CacheAcquireComplete;
84
WixBA.Model.Bootstrapper.ExecutePackageBegin += this.ExecutePackageBegin;
85
WixBA.Model.Bootstrapper.ExecutePackageComplete += this.ExecutePackageComplete;
86
WixBA.Model.Bootstrapper.Error += this.ExecuteError;
86
- WixBA.Model.Bootstrapper.ResolveSource += this.ResolveSource;
87
WixBA.Model.Bootstrapper.ApplyComplete += this.ApplyComplete;
88
}
89
@@ -492,9 +492,32 @@ namespace WixToolset.WixBA
492
this.cachePackageStart = DateTime.Now;
493
}
494
495
+ private void CacheAcquireResolving(object sender, CacheAcquireResolvingEventArgs e)
496
+ {
497
+ if (e.Action == CacheResolveOperation.Download && !this.downloadRetries.ContainsKey(e.PackageOrContainerId))
498
+ {
499
+ this.downloadRetries.Add(e.PackageOrContainerId, 0);
500
+ }
501
+ }
502
+
503
private void CacheAcquireComplete(object sender, CacheAcquireCompleteEventArgs e)
504
{
505
this.AddPackageTelemetry("Cache", e.PackageOrContainerId ?? String.Empty, DateTime.Now.Subtract(this.cachePackageStart).TotalMilliseconds, e.Status);
506
+
507
+ if (e.Status < 0 && this.downloadRetries.TryGetValue(e.PackageOrContainerId, out var retries) && retries < 3)
508
+ {
509
+ this.downloadRetries[e.PackageOrContainerId] = retries + 1;
510
+ switch (e.Status)
511
+ {
512
+ case -2147023294: //HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)
513
+ case -2147024894: //HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
514
+ case -2147012889: //HRESULT_FROM_WIN32(ERROR_INTERNET_NAME_NOT_RESOLVED)
515
+ break;
516
+ default:
517
+ e.Action = BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION.Retry;
518
+ break;
519
+ }
520
+ }
521
}
522
523
private void ExecutePackageBegin(object sender, ExecutePackageBeginEventArgs e)
@@ -584,16 +607,6 @@ namespace WixToolset.WixBA
607
}
608
}
609
587
- private void ResolveSource(object sender, ResolveSourceEventArgs e)
588
- {
589
- int retries = 0;
590
-
591
- this.downloadRetries.TryGetValue(e.PackageOrContainerId, out retries);
592
- this.downloadRetries[e.PackageOrContainerId] = retries + 1;
593
-
594
- e.Action = retries < 3 && !String.IsNullOrEmpty(e.DownloadSource) ? BOOTSTRAPPER_RESOLVESOURCE_ACTION.Download : BOOTSTRAPPER_RESOLVESOURCE_ACTION.None;
595
- }
596
-
610
private void ApplyComplete(object sender, ApplyCompleteEventArgs e)
611
{
612
WixBA.Model.Result = e.Status; // remember the final result of the apply.
src/WixToolset.WixBA/ProgressViewModel.cs
+33
@@ -40,6 +40,9 @@ namespace WixToolset.WixBA
40
WixBA.Model.Bootstrapper.ApplyBegin += this.ApplyBegin;
41
WixBA.Model.Bootstrapper.Progress += this.ApplyProgress;
42
WixBA.Model.Bootstrapper.CacheAcquireProgress += this.CacheAcquireProgress;
43
+ WixBA.Model.Bootstrapper.CacheContainerOrPayloadVerifyProgress += CacheContainerOrPayloadVerifyProgress;
44
+ WixBA.Model.Bootstrapper.CachePayloadExtractProgress += CachePayloadExtractProgress;
45
+ WixBA.Model.Bootstrapper.CacheVerifyProgress += CacheVerifyProgress;
46
WixBA.Model.Bootstrapper.CacheComplete += this.CacheComplete;
47
}
48
@@ -184,6 +187,36 @@ namespace WixToolset.WixBA
187
}
188
}
189
190
+ private void CacheContainerOrPayloadVerifyProgress(object sender, CacheContainerOrPayloadVerifyProgressEventArgs e)
191
+ {
192
+ lock (this)
193
+ {
194
+ this.cacheProgress = e.OverallPercentage;
195
+ this.Progress = (this.cacheProgress + this.executeProgress) / this.progressPhases;
196
+ e.Cancel = this.root.Canceled;
197
+ }
198
+ }
199
+
200
+ private void CachePayloadExtractProgress(object sender, CachePayloadExtractProgressEventArgs e)
201
+ {
202
+ lock (this)
203
+ {
204
+ this.cacheProgress = e.OverallPercentage;
205
+ this.Progress = (this.cacheProgress + this.executeProgress) / this.progressPhases;
206
+ e.Cancel = this.root.Canceled;
207
+ }
208
+ }
209
+
210
+ private void CacheVerifyProgress(object sender, CacheVerifyProgressEventArgs e)
211
+ {
212
+ lock (this)
213
+ {
214
+ this.cacheProgress = e.OverallPercentage;
215
+ this.Progress = (this.cacheProgress + this.executeProgress) / this.progressPhases;
216
+ e.Cancel = this.root.Canceled;
217
+ }
218
+ }
219
+
220
private void CacheComplete(object sender, CacheCompleteEventArgs e)
221
{
222
lock (this)
src/WixToolset.WixBA/WixToolset.WixBA.csproj
+1
-1
@@ -41,6 +41,6 @@
41
</ItemGroup>
42
<ItemGroup>
43
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" />
44
- <PackageReference Include="WixToolset.Mba.Core" Version="4.0.49" />
44
+ <PackageReference Include="WixToolset.Mba.Core" Version="4.0.58" />
45
</ItemGroup>
46
</Project>
\ No newline at end of file