1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-12-01 13:24:25 +01:00

fixed Source Dedicated Server, added TF2 support and removed Steam check (no longer asks you to close Steam before you install MM:S)

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40507
This commit is contained in:
Christian Hammacher 2007-10-13 20:10:19 +00:00
parent 93ead5a2e0
commit 5c49d4c583
3 changed files with 48 additions and 28 deletions

Binary file not shown.

View File

@ -229,7 +229,7 @@ begin
frmMain.ggeItem.MaxValue := 1;
frmMain.ggeItem.Progress := 0;
if (GetProcessID('Steam.exe') <> -1) and (SteamInstall) then begin
{if (GetProcessID('Steam.exe') <> -1) and (SteamInstall) then begin
if MessageBox(frmMain.Handle, 'Steam is still running. It is necersarry to shut it down before you install Metamod:Source. Shut it down now?', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNO) = mrYes then begin
AddStatus('Shutting down Steam...', clBlack, False);
if GetProcessID('Steam.exe') = -1 then
@ -247,7 +247,7 @@ begin
Application.Terminate;
exit;
end;
end;
end;}
frmMain.ggeAll.Progress := 1;
frmMain.ggeItem.Progress := 1;
{ Unpack }

View File

@ -218,7 +218,40 @@ begin
Close
else if jplWizard.ActivePage = jspSelectMod then begin
{ Dedicated Server }
if (frbDedicatedServer.Checked) or (frbStandaloneServer.Checked) then begin
if frbDedicatedServer.Checked then begin
Source := True;
ePath := trvMods.Selected.Text;
if ePath = 'Counter-Strike:Source' then
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\cstrike'
else if ePath = 'Day of Defeat:Source' then
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\dod'
else if ePath = 'Half-Life 2 Deathmatch' then
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\hl2mp'
else begin
{ get games }
if ePath = 'Team Fortress 2' then
ePath := trvMods.Selected.Parent.Text + '\source 2007 dedicated server\tf';
{ ask user, just in case }
case MessageBox(Handle, 'It looks like your server is using the OrangeBox engine. Would you like to install the appropriate binaries for it?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: Source := False;
mrNo: Source := True;
mrCancel: exit;
end;
end;
SteamPath := IncludeTrailingPathDelimiter(SteamPath) + 'steamapps\';
// install it
if DirectoryExists(SteamPath + ePath) then begin
jspInstallProgress.Show;
InstallDedicated(IncludeTrailingPathDelimiter(SteamPath + ePath), True, Source);
end
else begin
MessageBox(Handle, 'Error: The directory of the mod you selected doesn''t exist any more. Run Dedicated Server with the chosen mod and try again.', PChar(Application.Title), MB_ICONERROR);
jspSelectMod.Show;
exit;
end;
end;
{ Standalone Server }
if frbStandaloneServer.Checked then begin
Source := True;
ePath := trvMods.Selected.Text;
if ePath = 'Counter-Strike:Source' then
@ -230,7 +263,7 @@ begin
else begin
{ get games }
if ePath = 'Team Fortress 2' then
ePath := 'orangebox/tf'; // TODO: !HP! check this path
ePath := 'orangebox\tf';
{ ask user, just in case }
case MessageBox(Handle, 'It looks like your server is using the OrangeBox engine. Would you like to install the appropriate binaries for it?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: Source := False;
@ -238,29 +271,15 @@ begin
mrCancel: exit;
end;
end;
// install it
if frbDedicatedServer.Checked then begin
if DirectoryExists(SteamPath + ePath) then begin
jspInstallProgress.Show;
InstallDedicated(IncludeTrailingPathDelimiter(SteamPath + ePath), True, Source);
end
else begin
MessageBox(Handle, 'Error: The directory of the mod you selected doesn''t exist any more. Run Dedicated Server with the chosen mod and try again.', PChar(Application.Title), MB_ICONERROR);
jspSelectMod.Show;
exit;
end;
if DirectoryExists(StandaloneServer + ePath) then begin
jspInstallProgress.Show;
InstallDedicated(IncludeTrailingPathDelimiter(StandaloneServer + ePath), False, Source)
end
else begin
if DirectoryExists(StandaloneServer + ePath) then begin
jspInstallProgress.Show;
InstallDedicated(IncludeTrailingPathDelimiter(StandaloneServer + ePath), False, Source)
end
else begin
MessageBox(Handle, 'Error: The directory of the mod you selected doesn''t exist (any more). Run Half-Life Dedicated Server with the chosen mod again and restart.', PChar(Application.Title), MB_ICONERROR);
jspSelectMod.Show;
exit;
end;
MessageBox(Handle, 'Error: The directory of the mod you selected doesn''t exist (any more). Run Half-Life Dedicated Server with the chosen mod again and restart.', PChar(Application.Title), MB_ICONERROR);
jspSelectMod.Show;
exit;
end;
end;
{ Listen Server }
@ -325,7 +344,8 @@ begin
trvMods.Items.AddChild(CurNode, 'Day of Defeat:Source');
if DirectoryExists(ePath + eStr[i] + '\source dedicated server\hl2mp') then
trvMods.Items.AddChild(CurNode, 'Half-Life 2 Deatmatch');
// TODO: !HP! add "Team Fortress 2" item here
if DirectoryExists(ePath + eStr[i] + '\source 2007 dedicated server\tf') then
trvMods.Items.AddChild(CurNode, 'Team Fortress 2');
if CurNode.Count = 0 then
CurNode.Free
@ -417,10 +437,10 @@ begin
else if frbSelectMod.Checked then begin
{ Custom mod }
if frmSelectModPath.ShowModal = mrOk then begin
ePath := IncludeTrailingPathDelimiter(frmSelectModPath.trvDirectory.SelectedFolder.PathName);
ePath := frmSelectModPath.trvDirectory.SelectedFolder.PathName;
{ check if this is an orangebox game }
Source := True;
if (Pos('orangebox', LowerCase(ePath)) <> 0) then begin
if (AnsiSameText(ExtractFileName(ePath), 'tf')) then begin
case MessageBox(Handle, 'It looks like your server is using the OrangeBox engine. Would you like to install the appropriate binaries for it?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: Source := False;
mrNo: Source := True;
@ -429,7 +449,7 @@ begin
end;
{ install now }
jspInstallProgress.Show;
InstallCustom(ePath, osWindows, Source);
InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, Source);
end;
end
else if frbFTP.Checked then // FTP