1.1 --- a/installer/HL2Launch.dpr Thu Nov 30 22:53:20 2006 +0000
1.2 +++ b/installer/HL2Launch.dpr Thu Nov 30 22:53:44 2006 +0000
1.3 @@ -53,11 +53,8 @@
1.4 eStr: TStringList;
1.5 i: integer;
1.6 CheckSuccessful: Boolean;
1.7 + StartTime: Cardinal;
1.8 begin
1.9 - WriteLn(FindWindow(nil, 'STEAM'));
1.10 - readln;
1.11 - exit;
1.12 -
1.13 ePath := ExtractFilePath(ParamStr(0));
1.14 for i := 1 to ParamCount do
1.15 eParams := eParams + #32 + ParamStr(i);
1.16 @@ -87,7 +84,7 @@
1.17 ReadLn;
1.18 exit;
1.19 end;
1.20 - if not FileExists(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe') then begin
1.21 + if not FileExists(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath))) + 'steam.exe') then begin
1.22 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
1.23 WriteLn('Error: Cannot find steam.exe! Make sure this application is located in your listen server''s directory.');
1.24 ReadLn;
1.25 @@ -161,13 +158,17 @@
1.26 eStream := nil;
1.27 end;
1.28 { Launch Steam if not opened }
1.29 -
1.30 - ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath))), SW_SHOW);
1.31 - //ShellExecute(0, 'open',
1.32 + ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath))) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath)))), SW_SHOW);
1.33 { Launch game }
1.34 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
1.35 Write('Starting HL2...');
1.36 + StartTime := GetTickCount;
1.37 LaunchFile(ePath + 'hl2.exe', Copy(ePath, 1, Pos('Steam', ePath)+5), eParams);
1.38 + if (GetTickCount - StartTime < 10000) then begin
1.39 + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
1.40 + WriteLn('Important: If you experience any problems starting HL2 using this program, please start it once via Steam and try again.');
1.41 + ReadLn;
1.42 + end;
1.43 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
1.44 { Free GameInfo.txt }
1.45 Write('Removing read-only again from GameInfo.txt...');