mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-26 19:54:14 +01:00
fixed it up again :x
added notice if cs:s doesn't run longer than 10 seconds after start --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40314
This commit is contained in:
parent
1383a414d8
commit
0c59344bc6
@ -53,11 +53,8 @@ var eStream: TFileStream;
|
||||
eStr: TStringList;
|
||||
i: integer;
|
||||
CheckSuccessful: Boolean;
|
||||
StartTime: Cardinal;
|
||||
begin
|
||||
WriteLn(FindWindow(nil, 'STEAM'));
|
||||
readln;
|
||||
exit;
|
||||
|
||||
ePath := ExtractFilePath(ParamStr(0));
|
||||
for i := 1 to ParamCount do
|
||||
eParams := eParams + #32 + ParamStr(i);
|
||||
@ -87,7 +84,7 @@ begin
|
||||
ReadLn;
|
||||
exit;
|
||||
end;
|
||||
if not FileExists(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe') then begin
|
||||
if not FileExists(Copy(ePath, 1, Pos('\steamapps\', LowerCase(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;
|
||||
@ -161,13 +158,17 @@ begin
|
||||
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',
|
||||
ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath))) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath)))), SW_SHOW);
|
||||
{ Launch game }
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
|
||||
Write('Starting HL2...');
|
||||
StartTime := GetTickCount;
|
||||
LaunchFile(ePath + 'hl2.exe', Copy(ePath, 1, Pos('Steam', ePath)+5), eParams);
|
||||
if (GetTickCount - StartTime < 10000) then begin
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
|
||||
WriteLn('Important: If you experience any problems starting HL2 using this program, please start it once via Steam and try again.');
|
||||
ReadLn;
|
||||
end;
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
|
||||
{ Free GameInfo.txt }
|
||||
Write('Removing read-only again from GameInfo.txt...');
|
||||
|
Loading…
x
Reference in New Issue
Block a user