|
1 | | -using CloudVeilInstallerUI.Models; |
| 1 | +using CloudVeilInstallerUI.IPC; |
| 2 | +using CloudVeilInstallerUI.Models; |
2 | 3 | using InstallerCheckPackageCache; |
3 | 4 | using Microsoft.Deployment.WindowsInstaller; |
4 | 5 | using Microsoft.Tools.WindowsInstallerXml.Bootstrapper; |
|
10 | 11 | using System.IO; |
11 | 12 | using System.Net; |
12 | 13 | using System.Runtime.InteropServices; |
| 14 | +using System.Runtime.Remoting.Messaging; |
13 | 15 | using System.Threading.Tasks; |
14 | 16 | using System.Windows.Threading; |
15 | 17 | using CVInstallType = CloudVeilInstallerUI.Models.InstallType; |
@@ -478,6 +480,14 @@ private void DetectComplete(object sender, DetectCompleteEventArgs e) |
478 | 480 | return; |
479 | 481 | } |
480 | 482 |
|
| 483 | + var msiPlatform = ba.Engine.StringVariables["MsiPlatform"]; |
| 484 | + |
| 485 | + if (msiPlatform != null && msiPlatform.ToLower() != RuntimeInformation.OSArchitecture.ToString().ToLower()) |
| 486 | + { |
| 487 | + TriggerFailed($"Failed to {installTypeVerb} CloudVeil for Windows because this type of Windows ({RuntimeInformation.OSArchitecture}) is not supported."); |
| 488 | + return; |
| 489 | + } |
| 490 | + |
481 | 491 | LaunchAction desiredPlan = ba.Command.Action; |
482 | 492 |
|
483 | 493 | switch (ba.Command.Display) |
@@ -727,7 +737,16 @@ private void ApplyComplete(object sender, ApplyCompleteEventArgs e) |
727 | 737 | string message = null; |
728 | 738 | bool needsRestart = false; |
729 | 739 |
|
730 | | - message = $"Failed to {installTypeVerb} CloudVeil for Windows with error code {(uint)e.Status:x}. Please restart your computer and try again. If the issue persists, please contact support."; |
| 740 | + |
| 741 | + uint ustatus = (uint)e.Status; |
| 742 | + if (ustatus == ApplyStatus.FAIL_UNSUPPORTED_ARCH) |
| 743 | + { |
| 744 | + message = $"Failed to {installTypeVerb} CloudVeil for Windows because this type of Windows ({RuntimeInformation.OSArchitecture}) is not supported."; |
| 745 | + } |
| 746 | + else |
| 747 | + { |
| 748 | + message = $"Failed to {installTypeVerb} CloudVeil for Windows with error code {(uint)e.Status:x}. Please restart your computer and try again. If the issue persists, please contact support."; |
| 749 | + } |
731 | 750 |
|
732 | 751 | if ((installType == CVInstallType.Update || installType == CVInstallType.Uninstall) && failedPackageId == "CloudVeilForWindows") |
733 | 752 | { |
|
0 commit comments