diff --git a/Launcher2/Utils/Client.cs b/Launcher2/Utils/Client.cs index bcb458b91..c010c9786 100644 --- a/Launcher2/Utils/Client.cs +++ b/Launcher2/Utils/Client.cs @@ -1,7 +1,9 @@ using System; +using System.ComponentModel; using System.Diagnostics; using System.IO; using ClassicalSharp; +using OpenTK; namespace Launcher2 { @@ -32,8 +34,19 @@ namespace Launcher2 { return false; CheckSettings( data, classicubeSkins, out shouldExit ); - if( Type.GetType( "Mono.Runtime" ) != null ) { - process = Process.Start( "mono", "\"" + path + "\" " + args ); + if( Configuration.RunningOnMono ) { + // We also need to handle the case of running Mono through wine + if( Configuration.RunningOnWindows ) { + try { + process = Process.Start( "mono", "\"" + path + "\" " + args ); + } catch( Win32Exception ex ) { + if( !((uint)ex.ErrorCode == 0x80070002 || (uint)ex.ErrorCode == 0x80004005) ) + throw; // File not found HRESULT, HRESULT thrown when running on wine + process = Process.Start( path, args ); + } + } else { + process = Process.Start( "mono", "\"" + path + "\" " + args ); + } } else { process = Process.Start( path, args ); }