Get the client to run on wine properly.

This commit is contained in:
UnknownShadow200 2016-01-06 10:15:17 +11:00
parent 5b35cb4507
commit 29e797fa9c

View File

@ -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 );
}