Fix the 'ClassicalSharp.exe needs to be in the same folder' message incorrectly showing when starting the client via terminal on non-windows from another directory. (Thanks MrGoober)

This commit is contained in:
UnknownShadow200 2016-08-18 10:24:10 +10:00
parent 202b6a99aa
commit 99018cc610

View file

@ -16,12 +16,13 @@ namespace Launcher {
[STAThread]
static void Main( string[] args ) {
if( !File.Exists( "ClassicalSharp.exe" ) ) {
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
string clientPath = Path.Combine( AppDirectory, "ClassicalSharp.exe" );
if( !File.Exists( clientPath ) ) {
MessageBox.Show( "ClassicalSharp.exe needs to be in the same folder as the launcher.", "Missing file" );
return;
}
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
string logPath = Path.Combine( AppDirectory, "launcher.log" );
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
ErrorHandler2.InstallHandler( logPath );