Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added logic to check for Seamsless Multiplayer mod before main … #124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions EldenRingFPSUnlockAndMore/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ private async Task SafeStartGame(string path = null)
gameExePath = PromptForGamePath();
else
{
if (File.Exists(Path.Combine(gamePath, "GAME", $"{Properties.Settings.Default.GameName}.exe")))
if (File.Exists(Path.Combine(gamePath, "GAME", $"{Properties.Settings.Default.SeamlessMP}.exe")))
gameExePath = Path.Combine(gamePath, "GAME", $"{Properties.Settings.Default.SeamlessMP}.exe");
else if (File.Exists(Path.Combine(gamePath, "GAME", $"{Properties.Settings.Default.GameName}.exe")))
gameExePath = Path.Combine(gamePath, "GAME", $"{Properties.Settings.Default.GameName}.exe");
else if (File.Exists(Path.Combine(gamePath, $"{Properties.Settings.Default.GameName}.exe")))
gameExePath = Path.Combine(gamePath, $"{Properties.Settings.Default.GameName}.exe");
Expand All @@ -259,8 +261,13 @@ private async Task SafeStartGame(string path = null)
else
{
var fileInfo = FileVersionInfo.GetVersionInfo(gameExePath);
if (!fileInfo.FileDescription.ToLower().Contains(GameData.PROCESS_DESCRIPTION))
gameExePath = PromptForGamePath();
var filesDescription = fileInfo.FileDescription;
if (!gameExePath.ToLower().Contains("seamlesscoop.exe"))
{
if (!fileInfo.FileDescription.ToLower().Contains(GameData.PROCESS_DESCRIPTION))
gameExePath = PromptForGamePath();
}

}
Properties.Settings.Default.GamePath = gameExePath;
gamePath = Path.GetDirectoryName(gameExePath);
Expand All @@ -276,6 +283,8 @@ private async Task SafeStartGame(string path = null)
Environment.Exit(0);
}



// start steam
if (cbDisableSteamCheck.IsChecked == false)
{
Expand All @@ -298,21 +307,23 @@ private async Task SafeStartGame(string path = null)
}
}

string gameExePathArg = gameExePath.ToLower().Contains("seamlesscoop.exe") ? Properties.Settings.Default.SeamlessMP : Properties.Settings.Default.GamePath;

// start the game
ProcessStartInfo siGame = new ProcessStartInfo
{
WindowStyle = ProcessWindowStyle.Hidden,
Verb = "runas",
FileName = "cmd.exe",
WorkingDirectory = gamePath,
Arguments = $"/C \"{Properties.Settings.Default.GameName}.exe -noeac\""
Arguments = $"/C \"{gameExePathArg}.exe -noeac\""
};
Process procGameStarter = new Process
{
StartInfo = siGame
};
procGameStarter.Start();
await WaitForProgram(Properties.Settings.Default.GameName, 10000);
await WaitForProgram(gameExePathArg, 10000);
await Task.Delay(4000);
procGameStarter.Close();
_startup = false;
Expand Down
12 changes: 12 additions & 0 deletions EldenRingFPSUnlockAndMore/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.