mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Make exception detection language agnostic
mfw windows
This commit is contained in:
parent
35253145cc
commit
0df4840873
@ -1396,9 +1396,9 @@ namespace Bloxstrap
|
|||||||
UpdateProgressBar();
|
UpdateProgressBar();
|
||||||
|
|
||||||
// attempt download over HTTP
|
// attempt download over HTTP
|
||||||
// this isn't actually that unsafe - signatures were established earlier over HTTPS
|
// 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 no MITM anyway
|
// so we've already established that our signatures are legit, and that there's very likely no MITM anyway
|
||||||
if (ex.Message.Contains("The decryption operation failed"))
|
if (ex.GetType() == typeof(IOException) && !packageUrl.StartsWith("http://"))
|
||||||
{
|
{
|
||||||
App.Logger.WriteLine(LOG_IDENT, "Retrying download over HTTP...");
|
App.Logger.WriteLine(LOG_IDENT, "Retrying download over HTTP...");
|
||||||
packageUrl = packageUrl.Replace("https://", "http://");
|
packageUrl = packageUrl.Replace("https://", "http://");
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
{
|
{
|
||||||
// https://learn.microsoft.com/en-us/windows/win32/msi/error-codes
|
// https://learn.microsoft.com/en-us/windows/win32/msi/error-codes
|
||||||
// https://i-logic.com/serial/errorcodes.htm
|
// 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
|
// just the ones that we're interested in
|
||||||
|
|
||||||
public enum ErrorCode
|
public enum ErrorCode
|
||||||
@ -9,6 +10,8 @@
|
|||||||
ERROR_SUCCESS = 0,
|
ERROR_SUCCESS = 0,
|
||||||
ERROR_INSTALL_USEREXIT = 1602,
|
ERROR_INSTALL_USEREXIT = 1602,
|
||||||
ERROR_INSTALL_FAILURE = 1603,
|
ERROR_INSTALL_FAILURE = 1603,
|
||||||
ERROR_CANCELLED = 1223
|
ERROR_CANCELLED = 1223,
|
||||||
|
|
||||||
|
CO_E_APPNOTFOUND = -2147221003
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace Bloxstrap
|
|||||||
{
|
{
|
||||||
// lmfao
|
// lmfao
|
||||||
|
|
||||||
if (!ex.Message.Contains("Application not found"))
|
if (ex.NativeErrorCode != (int)ErrorCode.CO_E_APPNOTFOUND)
|
||||||
throw;
|
throw;
|
||||||
|
|
||||||
Process.Start(new ProcessStartInfo
|
Process.Start(new ProcessStartInfo
|
||||||
|
Loading…
Reference in New Issue
Block a user