Skip to content

Commit

Permalink
Fix bitness and crt error detection on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Sep 21, 2020
1 parent 2d4f642 commit 3fd6a69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Imageflow/Bindings/NativeLibraryLoading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ internal void RaiseException()
? string.Format(CultureInfo.InvariantCulture, "0x{0:X8}", e.loadErrorCode.Value)
: e.loadErrorCode.Value.ToString(CultureInfo.InvariantCulture);

sb.AppendFormat("Error \"{0}\" {1} loading {2} from {3}",
sb.AppendFormat("Error \"{0}\" ({1}) loading {2} from {3}",
new Win32Exception(e.loadErrorCode.Value).Message,
errorCode,
e.basename, e.fullPath);

if ((uint)e.loadErrorCode.Value == 0x8007000B &&
if (e.loadErrorCode.Value == 193 &&
RuntimeFileLocator.PlatformRuntimePrefix.Value == "win")
{
var installed = Environment.Is64BitProcess ? "32-bit (x86)" : "64-bit (x86_64)" ;
Expand All @@ -88,7 +88,7 @@ internal void RaiseException()
installed, needed);
}

if ((uint)e.loadErrorCode.Value == 0x8007007E &&
if (e.loadErrorCode.Value == 126 &&
RuntimeFileLocator.PlatformRuntimePrefix.Value == "win")
{
var crtLink = "https://aka.ms/vs/16/release/vc_redist."
Expand Down

0 comments on commit 3fd6a69

Please sign in to comment.