diff --git a/Native.cs b/Native.cs index cb389d46..e7fb41f4 100644 --- a/Native.cs +++ b/Native.cs @@ -271,5 +271,18 @@ public static long zip_source_make_command_bitmap (params SourceCommand[] cmd) } return bitmap; } + + [DllImport ("kernel32.dll", SetLastError = true)] + private static extern bool SetDllDirectory (string lpPathName); + + static Native () + { + if (Environment.OSVersion.Platform == PlatformID.Win32NT) { + string executingDirectory = System.IO.Path.GetDirectoryName (typeof(Native).Assembly.Location); + if (Environment.Is64BitProcess) { + SetDllDirectory (System.IO.Path.Combine (executingDirectory, "x64")); + } + } + } } }