[Launcher] Option to launch divahook.bat instead of diva.exe

This commit is contained in:
nastys
2020-06-03 00:13:54 +02:00
parent 6b631b2ef1
commit e8ca90426e
3 changed files with 23 additions and 7 deletions
+2
View File
@@ -21,6 +21,8 @@ OpenGL_Patch_A=0
OpenGL_Patch_B=0
# Command line arguments
Command_Line=
# Launches divahook.bat intead of diva.exe.
Use_divahook_bat=0
[Patches]
#Enable or disable mouse cursor
@@ -33,6 +33,9 @@ wstring DirPath() {
wstring DIVA_EXECUTABLE_STRING = ExePath();
LPCWSTR DIVA_EXECUTABLE = DIVA_EXECUTABLE_STRING.c_str();
wstring DIVA_DIRPATH_STRING = DirPath();
LPCWSTR DIVA_DIRPATH = DIVA_DIRPATH_STRING.c_str();
wstring DIVA_EXECUTABLE_LAUNCH_STRING = DIVA_EXECUTABLE_STRING + L" --launch";
LPWSTR DIVA_EXECUTABLE_LAUNCH = const_cast<WCHAR*>(DIVA_EXECUTABLE_LAUNCH_STRING.c_str());
@@ -205,10 +208,11 @@ ConfigOptionBase* optionsArray[] = {
new BooleanOption(L"opengl_patch_b", LAUNCHER_SECTION, CONFIG_FILE, L"OpenGL Patch B", L"Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing.", L"", false),
new OptionMetaSpacer(8),
new BooleanOption(L"custom_patches", PATCHES_SECTION, CONFIG_FILE, L"Enable custom patches", L"Enable all custom patches.", true, false),
new BooleanOption(L"custom_patches", PATCHES_SECTION, CONFIG_FILE, L"Enable custom patches", L"Enables all custom patches.", true, false),
new BooleanOption(L"no_gpu_dialog", LAUNCHER_SECTION, CONFIG_FILE, L"Disable GPU Warning", L"Disables the warning dialog for unsupported GPUs.", L"", false),
//new BooleanOption(L"ignore_exe_checksum", PATCHES_SECTION, CONFIG_FILE, L"Ignore exe checksum", L"Use at your own risk.", false, false),
new StringOption(L"command_line", LAUNCHER_SECTION, CONFIG_FILE, L"Command Line:", L"Allows setting command line parameters for the game when using the launcher.\nDisabling the launcher will bypass this.", L"", false),
new BooleanOption(L"use_divahook_bat", LAUNCHER_SECTION, CONFIG_FILE, L"Use divahook.bat", L"Launches divahook.bat intead of diva.exe.", L"", false),
};
ConfigOptionBase* playerdataArray[] = {
+16 -6
View File
@@ -671,13 +671,23 @@ private: System::Void Button_Launch_Click(System::Object^ sender, System::EventA
SaveSettings();
// read the command line here so it'll be up to date even if the user changed it
WCHAR stringBuf[256];
GetPrivateProfileStringW(LAUNCHER_SECTION, L"command_line", L"", stringBuf, 256, CONFIG_FILE);
DIVA_EXECUTABLE_LAUNCH_STRING += L" " + wstring(stringBuf);
DIVA_EXECUTABLE_LAUNCH = const_cast<WCHAR*>(DIVA_EXECUTABLE_LAUNCH_STRING.c_str());
if(GetPrivateProfileIntW(LAUNCHER_SECTION, L"use_divahook_bat", FALSE, CONFIG_FILE))
{
DIVA_EXECUTABLE = NULL;
wstring DIVA_EXECUTABLE_LAUNCH_STRING = L"cmd.exe /C \"";
DIVA_EXECUTABLE_LAUNCH_STRING.append(DIVA_DIRPATH);
DIVA_EXECUTABLE_LAUNCH_STRING.append(L"\\divahook.bat\"");
DIVA_EXECUTABLE_LAUNCH = const_cast<WCHAR*>(DIVA_EXECUTABLE_LAUNCH_STRING.c_str());
}
else
{
// read the command line here so it'll be up to date even if the user changed it
WCHAR stringBuf[256];
GetPrivateProfileStringW(LAUNCHER_SECTION, L"command_line", L"", stringBuf, 256, CONFIG_FILE);
DIVA_EXECUTABLE_LAUNCH_STRING += L" " + wstring(stringBuf);
DIVA_EXECUTABLE_LAUNCH = const_cast<WCHAR*>(DIVA_EXECUTABLE_LAUNCH_STRING.c_str());
}
STARTUPINFOW si;
PROCESS_INFORMATION pi;