// ReSharper disable InconsistentNaming private static void Main(string[] args) // ReSharper restore InconsistentNaming { #if !DEBUG AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; #endif AppDomain.CurrentDomain.AssemblyResolve += _AssemblyResolver; COSFunctions.AddEnvironmentPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libs\\unmanaged\\")); #if ARCH_X86 COSFunctions.AddEnvironmentPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libs\\unmanaged\\x86\\")); #endif #if ARCH_X64 COSFunctions.AddEnvironmentPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libs\\unmanaged\\x64\\")); #endif // Close program if there is another instance running if (!_EnsureSingleInstance()) { return; } #if !DEBUG try { _Run(args); } catch (Exception e) { CLog.Fatal(e, "Unhandled error: {ErrorMessage}", CLog.Params(e.Message)); } #else _Run(args); #endif _CloseProgram(); }
public static void Init() { #if ARCH_X86 string path = "x86"; #endif #if ARCH_X64 string path = "x64"; #endif path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + path; COSFunctions.AddEnvironmentPath(path); #if LINUX _EnsureDataFolderExists(); #endif }