[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
+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;