installer/HL2Launch.dpr
changeset 182 f60d482a6e07
parent 173 c36e2cf2baad
child 269 f241c05cb154
     1.1 --- a/installer/HL2Launch.dpr	Thu Feb 09 08:34:31 2006 +0000
     1.2 +++ b/installer/HL2Launch.dpr	Sun Feb 12 21:07:31 2006 +0000
     1.3 @@ -54,6 +54,10 @@
     1.4      i: integer;
     1.5      CheckSuccessful: Boolean;
     1.6  begin
     1.7 +  WriteLn(FindWindow(nil, 'STEAM'));
     1.8 +  readln;
     1.9 +  exit;
    1.10 +
    1.11    ePath := ExtractFilePath(ParamStr(0));
    1.12    for i := 1 to ParamCount do
    1.13      eParams := eParams + #32 + ParamStr(i);
    1.14 @@ -83,6 +87,12 @@
    1.15      ReadLn;
    1.16      exit;
    1.17    end;
    1.18 +  if not FileExists(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe') then begin
    1.19 +    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
    1.20 +    WriteLn('Error: Cannot find steam.exe! Make sure this application is located in your listen server''s directory.');
    1.21 +    ReadLn;
    1.22 +    exit;
    1.23 +  end;
    1.24    { Verify GameInfo.txt ... }
    1.25    Write('Verifying GameInfo.txt...');
    1.26    if (FindFirst(ePath + '*.*', faDirectory, eSearchRec) = 0) then begin
    1.27 @@ -150,6 +160,10 @@
    1.28      WriteLn('Warning: Couldn''t set GameInfo.txt to write-protected!');
    1.29      eStream := nil;
    1.30    end;
    1.31 +  { Launch Steam if not opened }
    1.32 +
    1.33 +  ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath))), SW_SHOW);
    1.34 +  //ShellExecute(0, 'open',
    1.35    { Launch game }
    1.36    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
    1.37    Write('Starting HL2...');