diff -r 50e55881d8c2 -r f60d482a6e07 installer/HL2Launch.dpr --- a/installer/HL2Launch.dpr Thu Feb 09 08:34:31 2006 +0000 +++ b/installer/HL2Launch.dpr Sun Feb 12 21:07:31 2006 +0000 @@ -54,6 +54,10 @@ i: integer; CheckSuccessful: Boolean; begin + WriteLn(FindWindow(nil, 'STEAM')); + readln; + exit; + ePath := ExtractFilePath(ParamStr(0)); for i := 1 to ParamCount do eParams := eParams + #32 + ParamStr(i); @@ -83,6 +87,12 @@ ReadLn; exit; end; + if not FileExists(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe') then begin + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); + WriteLn('Error: Cannot find steam.exe! Make sure this application is located in your listen server''s directory.'); + ReadLn; + exit; + end; { Verify GameInfo.txt ... } Write('Verifying GameInfo.txt...'); if (FindFirst(ePath + '*.*', faDirectory, eSearchRec) = 0) then begin @@ -150,6 +160,10 @@ WriteLn('Warning: Couldn''t set GameInfo.txt to write-protected!'); eStream := nil; end; + { Launch Steam if not opened } + + ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath))), SW_SHOW); + //ShellExecute(0, 'open', { Launch game } SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7); Write('Starting HL2...');