fix LaunchGame launching wrong version of executable

This commit is contained in:
Chris Danford
2005-12-07 20:18:21 +00:00
parent fc3433ca04
commit 68413b77cf
+13 -2
View File
@@ -176,9 +176,20 @@ void LaunchGame()
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
CString sFile = PRODUCT_NAME ".exe";
if( !DoesFileExist(sFile) )
{
sFile = "Program\\" + sFile;
if( !DoesFileExist(sFile) )
{
MessageBox( NULL, "Error", "Could not find " PRODUCT_NAME ".exe", MB_ICONEXCLAMATION );
return;
}
}
CreateProcess(
NULL, // pointer to name of executable module
PRODUCT_NAME ".exe", // pointer to command line string
sFile, // pointer to name of executable module
NULL, // pointer to command line string
NULL, // process security attributes
NULL, // thread security attributes
false, // handle inheritance flag