diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 6f767e3..d192b25 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -1396,9 +1396,9 @@ namespace Bloxstrap UpdateProgressBar(); // attempt download over HTTP - // this isn't actually that unsafe - signatures were established earlier over HTTPS - // so we've already established that our signatures are legit, and that there's no MITM anyway - if (ex.Message.Contains("The decryption operation failed")) + // this isn't actually that unsafe - signatures were fetched earlier over HTTPS + // so we've already established that our signatures are legit, and that there's very likely no MITM anyway + if (ex.GetType() == typeof(IOException) && !packageUrl.StartsWith("http://")) { App.Logger.WriteLine(LOG_IDENT, "Retrying download over HTTP..."); packageUrl = packageUrl.Replace("https://", "http://"); diff --git a/Bloxstrap/Enums/ErrorCode.cs b/Bloxstrap/Enums/ErrorCode.cs index d9fbd42..ba6b65e 100644 --- a/Bloxstrap/Enums/ErrorCode.cs +++ b/Bloxstrap/Enums/ErrorCode.cs @@ -2,6 +2,7 @@ { // https://learn.microsoft.com/en-us/windows/win32/msi/error-codes // https://i-logic.com/serial/errorcodes.htm + // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/705fb797-2175-4a90-b5a3-3918024b10b8 // just the ones that we're interested in public enum ErrorCode @@ -9,6 +10,8 @@ ERROR_SUCCESS = 0, ERROR_INSTALL_USEREXIT = 1602, ERROR_INSTALL_FAILURE = 1603, - ERROR_CANCELLED = 1223 + ERROR_CANCELLED = 1223, + + CO_E_APPNOTFOUND = -2147221003 } } diff --git a/Bloxstrap/Utilities.cs b/Bloxstrap/Utilities.cs index 533928a..565dc79 100644 --- a/Bloxstrap/Utilities.cs +++ b/Bloxstrap/Utilities.cs @@ -18,7 +18,7 @@ namespace Bloxstrap { // lmfao - if (!ex.Message.Contains("Application not found")) + if (ex.NativeErrorCode != (int)ErrorCode.CO_E_APPNOTFOUND) throw; Process.Start(new ProcessStartInfo