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

battleye: Add support for -exe command line argument. #145

Open
wants to merge 1 commit into
base: proton_7.0
Choose a base branch
from

Conversation

mundak
Copy link

@mundak mundak commented Apr 27, 2022

Games can use this argument to override executable entries from BELauncher.ini.

@Guy1524
Copy link
Contributor

Guy1524 commented Apr 28, 2022

Thanks for the patch, what game/s use this?

game_cmd = cmdline;

/* Check if -exe argument was passed, which will override .ini entry */
cmd_exe_arg = wcsstr(cmdline, L"-exe ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check comes after we read from BELauncher.ini, and if we don't find the file, the launcher fails. Are we sure that the .ini file is needed if an -exe arg is passed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I don't know. The .ini file is still present in my case, where executable is overriden by -exe argument.

programs/belauncher/main.c Outdated Show resolved Hide resolved
programs/belauncher/main.c Outdated Show resolved Hide resolved
programs/belauncher/main.c Outdated Show resolved Hide resolved
Games can use this argument to override executable entries from BELauncher.exe.

Change-Id: I53bed6c1591d77d5a382d50dfc692bfc90321846
@mundak
Copy link
Author

mundak commented Apr 29, 2022

Thank you for taking the time to review my patch!

Please take a look at the updated version - I've incorporated your feedback.
Also, I took a liberty to add a little bit more logging.

I've written some local tests to make sure different variants are supported, see the output below:

0024:trace:belauncher:wWinMain Started BELauncher with parameters: L""
0024:trace:belauncher:wWinMain Launching game executable for BattlEye: L"ExeFromIni.exe  -FromIniArg1 -FromIniArg2 /FromIniArg3"

00c0:trace:belauncher:wWinMain Started BELauncher with parameters: L"/some /unrelated=args /b=\\\"some\\\""
00c0:trace:belauncher:wWinMain Launching game executable for BattlEye: L"ExeFromIni.exe /some /unrelated=args /b=\\\"some\\\" -FromIniArg1 -FromIniArg2 /FromIniArg3"

00d0:trace:belauncher:wWinMain Started BELauncher with parameters: L"-exe some.exe"
00d0:trace:belauncher:wWinMain Launching game executable for BattlEye: L"some.exe   -FromIniArg1 -FromIniArg2 /FromIniArg3"

00e0:trace:belauncher:wWinMain Started BELauncher with parameters: L"/args -exe some.exe"
00e0:trace:belauncher:wWinMain Launching game executable for BattlEye: L"some.exe /args   -FromIniArg1 -FromIniArg2 /FromIniArg3"

00f0:trace:belauncher:wWinMain Started BELauncher with parameters: L"/args -exe some.exe /more"
00f0:trace:belauncher:wWinMain Launching game executable for BattlEye: L"some.exe /args  /more -FromIniArg1 -FromIniArg2 /FromIniArg3"

0100:trace:belauncher:wWinMain Started BELauncher with parameters: L"-exe some.exe /more"
0100:trace:belauncher:wWinMain Launching game executable for BattlEye: L"some.exe  /more -FromIniArg1 -FromIniArg2 /FromIniArg3"

0110:trace:belauncher:wWinMain Started BELauncher with parameters: L"-exe \\\"some with space.exe\\\""
0110:trace:belauncher:wWinMain Launching game executable for BattlEye: L"\\\"some with space.exe\\\"   -FromIniArg1 -FromIniArg2 /FromIniArg3"

0120:trace:belauncher:wWinMain Started BELauncher with parameters: L"/args -exe \\\"some with space.exe\\\""
0120:trace:belauncher:wWinMain Launching game executable for BattlEye: L"\\\"some with space.exe\\\" /args   -FromIniArg1 -FromIniArg2 /FromIniArg3"

0130:trace:belauncher:wWinMain Started BELauncher with parameters: L"/args -exe \\\"some with space.exe\\\" /more"
0130:trace:belauncher:wWinMain Launching game executable for BattlEye: L"\\\"some with space.exe\\\" /args  /more -FromIniArg1 -FromIniArg2 /FromIniArg3"

0140:trace:belauncher:wWinMain Started BELauncher with parameters: L"-exe \\\"some with space.exe\\\" /more /args"
0140:trace:belauncher:wWinMain Launching game executable for BattlEye: L"\\\"some with space.exe\\\"  /more /args -FromIniArg1 -FromIniArg2 /FromIniArg3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants