diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-05-05 21:01:28 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-05-11 19:11:19 -0500 |
| commit | 3c88529e8e29f9763a6830f8d3ac29cd56a4cb33 (patch) | |
| tree | 351ce09b5ec32909159dfb8bf93b713445bc69a3 /src | |
| parent | bd6bd5c262fe7e4faa3e7815ebe6036e7ab456e1 (diff) | |
| download | wix-3c88529e8e29f9763a6830f8d3ac29cd56a4cb33.tar.gz wix-3c88529e8e29f9763a6830f8d3ac29cd56a4cb33.tar.bz2 wix-3c88529e8e29f9763a6830f8d3ac29cd56a4cb33.zip | |
Update WixBA to Mba.Core 4.0.58.
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.WixBA/InstallationViewModel.cs | 35 | ||||
| -rw-r--r-- | src/WixToolset.WixBA/ProgressViewModel.cs | 33 | ||||
| -rw-r--r-- | src/WixToolset.WixBA/WixToolset.WixBA.csproj | 2 |
3 files changed, 58 insertions, 12 deletions
diff --git a/src/WixToolset.WixBA/InstallationViewModel.cs b/src/WixToolset.WixBA/InstallationViewModel.cs index c7b736ff..2beebd02 100644 --- a/src/WixToolset.WixBA/InstallationViewModel.cs +++ b/src/WixToolset.WixBA/InstallationViewModel.cs | |||
| @@ -79,11 +79,11 @@ namespace WixToolset.WixBA | |||
| 79 | WixBA.Model.Bootstrapper.PlanComplete += this.PlanComplete; | 79 | WixBA.Model.Bootstrapper.PlanComplete += this.PlanComplete; |
| 80 | WixBA.Model.Bootstrapper.ApplyBegin += this.ApplyBegin; | 80 | WixBA.Model.Bootstrapper.ApplyBegin += this.ApplyBegin; |
| 81 | WixBA.Model.Bootstrapper.CacheAcquireBegin += this.CacheAcquireBegin; | 81 | WixBA.Model.Bootstrapper.CacheAcquireBegin += this.CacheAcquireBegin; |
| 82 | WixBA.Model.Bootstrapper.CacheAcquireResolving += this.CacheAcquireResolving; | ||
| 82 | WixBA.Model.Bootstrapper.CacheAcquireComplete += this.CacheAcquireComplete; | 83 | WixBA.Model.Bootstrapper.CacheAcquireComplete += this.CacheAcquireComplete; |
| 83 | WixBA.Model.Bootstrapper.ExecutePackageBegin += this.ExecutePackageBegin; | 84 | WixBA.Model.Bootstrapper.ExecutePackageBegin += this.ExecutePackageBegin; |
| 84 | WixBA.Model.Bootstrapper.ExecutePackageComplete += this.ExecutePackageComplete; | 85 | WixBA.Model.Bootstrapper.ExecutePackageComplete += this.ExecutePackageComplete; |
| 85 | WixBA.Model.Bootstrapper.Error += this.ExecuteError; | 86 | WixBA.Model.Bootstrapper.Error += this.ExecuteError; |
| 86 | WixBA.Model.Bootstrapper.ResolveSource += this.ResolveSource; | ||
| 87 | WixBA.Model.Bootstrapper.ApplyComplete += this.ApplyComplete; | 87 | WixBA.Model.Bootstrapper.ApplyComplete += this.ApplyComplete; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| @@ -492,9 +492,32 @@ namespace WixToolset.WixBA | |||
| 492 | this.cachePackageStart = DateTime.Now; | 492 | this.cachePackageStart = DateTime.Now; |
| 493 | } | 493 | } |
| 494 | 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 | |||
| 495 | private void CacheAcquireComplete(object sender, CacheAcquireCompleteEventArgs e) | 503 | private void CacheAcquireComplete(object sender, CacheAcquireCompleteEventArgs e) |
| 496 | { | 504 | { |
| 497 | this.AddPackageTelemetry("Cache", e.PackageOrContainerId ?? String.Empty, DateTime.Now.Subtract(this.cachePackageStart).TotalMilliseconds, e.Status); | 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 | } | ||
| 498 | } | 521 | } |
| 499 | 522 | ||
| 500 | private void ExecutePackageBegin(object sender, ExecutePackageBeginEventArgs e) | 523 | private void ExecutePackageBegin(object sender, ExecutePackageBeginEventArgs e) |
| @@ -584,16 +607,6 @@ namespace WixToolset.WixBA | |||
| 584 | } | 607 | } |
| 585 | } | 608 | } |
| 586 | 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 | |||
| 597 | private void ApplyComplete(object sender, ApplyCompleteEventArgs e) | 610 | private void ApplyComplete(object sender, ApplyCompleteEventArgs e) |
| 598 | { | 611 | { |
| 599 | WixBA.Model.Result = e.Status; // remember the final result of the apply. | 612 | WixBA.Model.Result = e.Status; // remember the final result of the apply. |
diff --git a/src/WixToolset.WixBA/ProgressViewModel.cs b/src/WixToolset.WixBA/ProgressViewModel.cs index 17af5cfe..6f7bb028 100644 --- a/src/WixToolset.WixBA/ProgressViewModel.cs +++ b/src/WixToolset.WixBA/ProgressViewModel.cs | |||
| @@ -40,6 +40,9 @@ namespace WixToolset.WixBA | |||
| 40 | WixBA.Model.Bootstrapper.ApplyBegin += this.ApplyBegin; | 40 | WixBA.Model.Bootstrapper.ApplyBegin += this.ApplyBegin; |
| 41 | WixBA.Model.Bootstrapper.Progress += this.ApplyProgress; | 41 | WixBA.Model.Bootstrapper.Progress += this.ApplyProgress; |
| 42 | WixBA.Model.Bootstrapper.CacheAcquireProgress += this.CacheAcquireProgress; | 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; | ||
| 43 | WixBA.Model.Bootstrapper.CacheComplete += this.CacheComplete; | 46 | WixBA.Model.Bootstrapper.CacheComplete += this.CacheComplete; |
| 44 | } | 47 | } |
| 45 | 48 | ||
| @@ -184,6 +187,36 @@ namespace WixToolset.WixBA | |||
| 184 | } | 187 | } |
| 185 | } | 188 | } |
| 186 | 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 | |||
| 187 | private void CacheComplete(object sender, CacheCompleteEventArgs e) | 220 | private void CacheComplete(object sender, CacheCompleteEventArgs e) |
| 188 | { | 221 | { |
| 189 | lock (this) | 222 | lock (this) |
diff --git a/src/WixToolset.WixBA/WixToolset.WixBA.csproj b/src/WixToolset.WixBA/WixToolset.WixBA.csproj index 5bc44b38..8f834cd8 100644 --- a/src/WixToolset.WixBA/WixToolset.WixBA.csproj +++ b/src/WixToolset.WixBA/WixToolset.WixBA.csproj | |||
| @@ -41,6 +41,6 @@ | |||
| 41 | </ItemGroup> | 41 | </ItemGroup> |
| 42 | <ItemGroup> | 42 | <ItemGroup> |
| 43 | <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" /> | 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> | 45 | </ItemGroup> |
| 46 | </Project> \ No newline at end of file | 46 | </Project> \ No newline at end of file |
