From 68413b77cf11fd59600028506c908fcad15256f7 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 7 Dec 2005 20:18:21 +0000 Subject: [PATCH] fix LaunchGame launching wrong version of executable --- stepmania/src/smpackage/SMPackageUtil.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/stepmania/src/smpackage/SMPackageUtil.cpp b/stepmania/src/smpackage/SMPackageUtil.cpp index b9abbf6a0d..23c177966f 100644 --- a/stepmania/src/smpackage/SMPackageUtil.cpp +++ b/stepmania/src/smpackage/SMPackageUtil.cpp @@ -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