diff --git a/GK6X/GK6X-gui.bat b/GK6X/GK6X-gui.bat index 143979b..f2f7935 100644 --- a/GK6X/GK6X-gui.bat +++ b/GK6X/GK6X-gui.bat @@ -1 +1 @@ -call %WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe GK6X.csproj /p:Configuration=Debug /p:OutputType=Winexe /p:AssemblyName=GK6X-gui \ No newline at end of file +call %WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe GK6X.csproj /p:Configuration=Debug /p:OutputType=Winexe /p:AssemblyName=GK6X-gui /p:DefineConstants=AS_GUI \ No newline at end of file diff --git a/GK6X/Program.cs b/GK6X/Program.cs index c6d8bae..fb0bc69 100644 --- a/GK6X/Program.cs +++ b/GK6X/Program.cs @@ -16,7 +16,11 @@ class Program static void Main(string[] args) { +#if AS_GUI + Run(asGUI: true); +#else Run(asGUI: false); +#endif Stop(); } @@ -36,17 +40,6 @@ static void Stop() static void Run(bool asGUI) { - try - { - if (Process.GetCurrentProcess().MainWindowHandle == IntPtr.Zero) - { - asGUI = true; - } - } - catch - { - } - BasePath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); DataBasePath = Path.Combine(BasePath, DataBasePath); UserDataPath = Path.Combine(BasePath, UserDataPath);