diff --git a/installer/MMS_Installer.exe b/installer/MMS_Installer.exe index 1ac99b8..0fb7c9b 100644 Binary files a/installer/MMS_Installer.exe and b/installer/MMS_Installer.exe differ diff --git a/installer/UnitInstall.pas b/installer/UnitInstall.pas index 4ef20e0..c43835a 100644 --- a/installer/UnitInstall.pas +++ b/installer/UnitInstall.pas @@ -263,8 +263,8 @@ begin CopyConfig := True; AddStatus('Creating directories...', clBlack); if DirectoryExists(ePath + 'addons\metamod\bin') then begin - case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to continue, No to Upgrade, or Cancel to abort the install.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of - mrNo: CopyConfig := False; + case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to upgrade, No to reinstall, or Cancel to abort the installation.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of + mrYes: CopyConfig := False; mrCancel: begin Application.Terminate; exit; @@ -464,8 +464,8 @@ begin eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'metamod.vdf'); frmMain.ggeItem.Progress := 2; if (((Pos('server.dll', eStr.Text) <> 0) and (OS = osWindows)) or ((Pos('server_i486.so', eStr.Text) <> 0) and (OS = osLinux))) then begin - case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to continue, No to Upgrade, or Cancel to abort the install.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of - mrNo: CopyConfig := False; + case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to upgrade, No to reinstall, or Cancel to abort the installation.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of + mrYes: CopyConfig := False; mrCancel: begin Application.Terminate; eStr.Free; @@ -526,6 +526,11 @@ begin if (CommentFound) then AddSkipped else begin + // delete empty lines first + for i := eStr.Count -1 downto 0 do begin + if (Trim(eStr[i]) = '') then + eStr.Delete(i); + end; // see http://svn.alliedmods.net/viewvc.cgi/metamodsource/orangebox/addons/metamod/metaplugins.ini?revision=1099&root=Packages eStr.Insert(0, ';List one plugin per line. Each line should contain the path to the plugin''s binary.'); eStr.Insert(1, ';Any line starting with a '';'' character is a comment line, and is ignored.'); diff --git a/installer/UnitSelectModPath.dfm b/installer/UnitSelectModPath.dfm index 436262c..ef9ae6a 100644 Binary files a/installer/UnitSelectModPath.dfm and b/installer/UnitSelectModPath.dfm differ diff --git a/installer/UnitSelectModPath.pas b/installer/UnitSelectModPath.pas index 368d478..99251cd 100644 --- a/installer/UnitSelectModPath.pas +++ b/installer/UnitSelectModPath.pas @@ -5,7 +5,7 @@ interface uses SysUtils, Windows, Messages, Classes, Graphics, Controls, StdCtrls, ExtCtrls, Forms, FileCtrl, ComCtrls, ShellCtrls, - TFlatComboBoxUnit, TFlatButtonUnit; + TFlatComboBoxUnit, TFlatButtonUnit, TFlatCheckBoxUnit; type TfrmSelectModPath = class(TForm) @@ -14,6 +14,8 @@ type trvDirectory: TShellTreeView; cmdOK: TFlatButton; cmdCancel: TFlatButton; + chkUsesOrangebox: TFlatCheckBox; + procedure trvDirectoryClick(Sender: TObject); end; var @@ -23,4 +25,11 @@ implementation {$R *.DFM} +procedure TfrmSelectModPath.trvDirectoryClick(Sender: TObject); +begin + // !! OrangeBox Check !! + if (trvDirectory.Selected <> nil) then + chkUsesOrangebox.Checked := (chkUsesOrangebox.Checked) or (trvDirectory.Selected.Text = 'tf'); +end; + end. diff --git a/installer/UnitfrmMain.pas b/installer/UnitfrmMain.pas index 0982d5e..dfe3d98 100644 --- a/installer/UnitfrmMain.pas +++ b/installer/UnitfrmMain.pas @@ -185,9 +185,9 @@ begin end else eStr.Free; - // check for orangebox directory + // check for orangebox directory (!! OrangeBox Check !!) Source := True; - if (AnsiSameText(trvDirectories.Selected.Text, 'tf')) then begin + if (AnsiSameText(trvDirectories.Selected.Text, 'tf')) or (Pos('orangebox', LowerCase(ePath)) <> 0) 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; @@ -221,11 +221,11 @@ begin if frbDedicatedServer.Checked then begin Source := True; ePath := trvMods.Selected.Text; - if ePath = 'Counter-Strike:Source' then + if (ePath = 'Counter-Strike:Source') then ePath := trvMods.Selected.Parent.Text + '\source dedicated server\cstrike' - else if ePath = 'Day of Defeat:Source' then + 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 + else if (ePath = 'Half-Life 2 Deathmatch') then ePath := trvMods.Selected.Parent.Text + '\source dedicated server\hl2mp' else begin { get games } @@ -318,9 +318,7 @@ begin end; { Custom mod below } end - else if jplWizard.ActivePage <> jspInstallMethod then - jplWizard.NextPage - else begin + else if (jplWizard.ActivePage = jspInstallMethod) then begin if frbDedicatedServer.Checked then begin // Dedicated Server eRegistry := TRegistry.Create(KEY_READ); try @@ -438,23 +436,16 @@ begin { Custom mod } if frmSelectModPath.ShowModal = mrOk then begin ePath := frmSelectModPath.trvDirectory.SelectedFolder.PathName; - { check if this is an orangebox game } - Source := True; - 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; - mrCancel: exit; - end; - end; { install now } jspInstallProgress.Show; - InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, Source); + InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, not frmSelectModPath.chkUsesOrangebox.Checked); end; end else if frbFTP.Checked then // FTP jspFTP.Show; - end; + end + else + jplWizard.NextPage end; procedure TfrmMain.CheckNext(Sender: TObject);