From 09243441bcf4dbdbbdfd94a23eb5f14aa7884310 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 8 Oct 2023 02:25:08 +0200 Subject: [PATCH] auto detect exe in same dir --- SoFii/Constants.cs | 1 + SoFii/Program.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/SoFii/Constants.cs b/SoFii/Constants.cs index f77e5a8..a0b813d 100644 --- a/SoFii/Constants.cs +++ b/SoFii/Constants.cs @@ -2,5 +2,6 @@ public static class Constants { public const string SOFII_DOMAIN = "_sofii.flashii.net."; public const string INFO_URL = "https://fii.moe/sofii"; + public const string MP_EXE = "SoF2MP.exe"; } } diff --git a/SoFii/Program.cs b/SoFii/Program.cs index 6d6d05a..8faa738 100644 --- a/SoFii/Program.cs +++ b/SoFii/Program.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Reflection; using System.Windows.Forms; @@ -23,6 +24,9 @@ namespace SoFii { } else if(version > lastVersion) Settings.LastVersion = version; + if(!File.Exists(Settings.GamePath) && File.Exists(Constants.MP_EXE)) + Settings.GamePath = Path.GetFullPath(Constants.MP_EXE); + Application.Run(new MainWindow()); }