diff --git a/libs/cmdlib/cmdlib.cpp b/libs/cmdlib/cmdlib.cpp index 3e26a06f..8736ddf8 100644 --- a/libs/cmdlib/cmdlib.cpp +++ b/libs/cmdlib/cmdlib.cpp @@ -115,6 +115,7 @@ bool Q_Exec( const char *cmd, char *cmdline, const char *execdir, bool bCreateCo &startupinfo, &ProcessInformation ) ) { + // NOTE: the docs suggest we should be closing the handles in PROCESS_INFORMATION here return true; } return false; diff --git a/radiant/main.cpp b/radiant/main.cpp index 6af9551b..5345c4d6 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -1221,12 +1221,26 @@ void RunBsp( char *command ){ g_pParentWnd->GetWatchBSP()->DoMonitoringLoop( sys, bspname ); } else { // write all the steps in a single BAT / .sh file and run it, don't bother monitoring it - CString strSys; + CString strSys = "echo off\n"; for ( i = 0; i < sys->len; i++ ) { strSys += (char *)g_ptr_array_index( sys, i ); - strSys += "\n"; - }; + strSys += "\nIF %ERRORLEVEL% NEQ 0 goto error\n"; + } + strSys += "\ +goto end\n\ +\n\ +:error\n\ +ECHO.\n\ +ECHO.\n\ +ECHO =======================================\n\ +ECHO =========== BSP STEP FAILED ===========\n\ +ECHO =======================================\n\ +ECHO.\n\ +\n\ +:end\n\ +pause\n\ +"; #if defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __APPLE__ )