*** empty log message ***
This commit is contained in:
parent
2f8e311140
commit
99f65175ff
BIN
installer/installer/AMX.ico
Executable file
BIN
installer/installer/AMX.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 766 B |
38
installer/installer/AMXInstaller.cfg
Executable file
38
installer/installer/AMXInstaller.cfg
Executable file
|
@ -0,0 +1,38 @@
|
|||
-$A8
|
||||
-$B-
|
||||
-$C+
|
||||
-$D+
|
||||
-$E-
|
||||
-$F-
|
||||
-$G+
|
||||
-$H+
|
||||
-$I+
|
||||
-$J-
|
||||
-$K-
|
||||
-$L+
|
||||
-$M-
|
||||
-$N+
|
||||
-$O+
|
||||
-$P+
|
||||
-$Q-
|
||||
-$R-
|
||||
-$S-
|
||||
-$T-
|
||||
-$U-
|
||||
-$V+
|
||||
-$W-
|
||||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-cg
|
||||
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
-H+
|
||||
-W+
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"c:\programme\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\programme\borland\delphi7\Projects\Bpl"
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
136
installer/installer/AMXInstaller.dof
Executable file
136
installer/installer/AMXInstaller.dof
Executable file
|
@ -0,0 +1,136 @@
|
|||
[FileVersion]
|
||||
Version=7.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=1
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=0
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
NamespacePrefix=
|
||||
SymbolDeprecated=1
|
||||
SymbolLibrary=1
|
||||
SymbolPlatform=1
|
||||
UnitLibrary=1
|
||||
UnitPlatform=1
|
||||
UnitDeprecated=1
|
||||
HResultCompat=1
|
||||
HidingMember=1
|
||||
HiddenVirtual=1
|
||||
Garbage=1
|
||||
BoundsError=1
|
||||
ZeroNilCompat=1
|
||||
StringConstTruncated=1
|
||||
ForLoopVarVarPar=1
|
||||
TypedConstVarPar=1
|
||||
AsgToTypedConst=1
|
||||
CaseLabelRange=1
|
||||
ForVariable=1
|
||||
ConstructingAbstract=1
|
||||
ComparisonFalse=1
|
||||
ComparisonTrue=1
|
||||
ComparingSignedUnsigned=1
|
||||
CombiningSignedUnsigned=1
|
||||
UnsupportedConstruct=1
|
||||
FileOpen=1
|
||||
FileOpenUnitSrc=1
|
||||
BadGlobalSymbol=1
|
||||
DuplicateConstructorDestructor=1
|
||||
InvalidDirective=1
|
||||
PackageNoLink=1
|
||||
PackageThreadVar=1
|
||||
ImplicitImport=1
|
||||
HPPEMITIgnored=1
|
||||
NoRetVal=1
|
||||
UseBeforeDef=1
|
||||
ForLoopVarUndef=1
|
||||
UnitNameMismatch=1
|
||||
NoCFGFileFound=1
|
||||
MessageDirective=1
|
||||
ImplicitVariants=1
|
||||
UnicodeToLocale=1
|
||||
LocaleToUnicode=1
|
||||
ImagebaseMultiple=1
|
||||
SuspiciousTypecast=1
|
||||
PrivatePropAccessor=1
|
||||
UnsafeType=0
|
||||
UnsafeCode=0
|
||||
UnsafeCast=0
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=
|
||||
[Directories]
|
||||
OutputDir=
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=
|
||||
Packages=vcl;rtl;vclx;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;VclSmp;dbrtl;dbexpress;vcldb;dsnap;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;JvStdCtrlsD7R;JvAppFrmD7R;JvCoreD7R;JvBandsD7R;JvBDED7R;JvDBD7R;JvDlgsD7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;qrpt;JvGlobusD7R;JvHMID7R;JvInspectorD7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvSystemD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;DelphiX_for7;Indy70;DJcl;tb2k_d7;FlatStyle_D5;scited7;mxFlatPack_D7;mbXPLib
|
||||
Conditionals=
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1031
|
||||
CodePage=1252
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
35
installer/installer/AMXInstaller.dpr
Executable file
35
installer/installer/AMXInstaller.dpr
Executable file
|
@ -0,0 +1,35 @@
|
|||
program AMXInstaller;
|
||||
|
||||
{ AMXX Installer 1.1
|
||||
by the AMXX Development Team
|
||||
|
||||
Used components:
|
||||
|
||||
- Indy 9 (www.indyproject.org)
|
||||
- FlatStyle Components (www.torry.net)
|
||||
- FlatPack Component Pack (www.torry.net)
|
||||
- JVCL Lib Pack 3.0 (jvcl.sourceforge.net)
|
||||
|
||||
AMXX Installer 1.1 is developed under GNU Public License
|
||||
and comes WITH ABSOLUTELY NO WARRANTY!
|
||||
}
|
||||
|
||||
uses
|
||||
Forms,
|
||||
UnitfrmMain in 'UnitfrmMain.pas' {frmMain},
|
||||
UnitFunctions in 'UnitFunctions.pas',
|
||||
UnitScanMods in 'UnitScanMods.pas',
|
||||
UnitfrmProxy in 'UnitfrmProxy.pas' {frmProxy},
|
||||
UnitInstall in 'UnitInstall.pas',
|
||||
UnitSelectModPath in 'UnitSelectModPath.pas' {frmSelectModPath};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.Title := 'AMX Mod X Installer';
|
||||
Application.CreateForm(TfrmMain, frmMain);
|
||||
Application.CreateForm(TfrmProxy, frmProxy);
|
||||
Application.CreateForm(TfrmSelectModPath, frmSelectModPath);
|
||||
Application.Run;
|
||||
end.
|
BIN
installer/installer/AMXInstaller.res
Executable file
BIN
installer/installer/AMXInstaller.res
Executable file
Binary file not shown.
126
installer/installer/UnitFunctions.pas
Executable file
126
installer/installer/UnitFunctions.pas
Executable file
|
@ -0,0 +1,126 @@
|
|||
unit UnitFunctions;
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils, Classes, Windows, IdFTPList, Math;
|
||||
|
||||
function CalcSpeed(eOld, eNew: Integer): String;
|
||||
// local
|
||||
function GetAllFiles(Mask: String; Attr: Integer; Recursive: Boolean; ShowDirs: Boolean; ShowPath: Boolean = True): TStringList;
|
||||
// ftp
|
||||
function GetAllDirs: TStringList;
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitfrmMain;
|
||||
|
||||
function CalcSpeed(eOld, eNew: Integer): String;
|
||||
begin
|
||||
Result := frmMain.Caption;
|
||||
if (eOld < eNew) and (eOld <> 0) then begin
|
||||
eOld := eNew - eOld;
|
||||
eOld := eOld *2; // twice per second, higher frequency is too inaccurate...
|
||||
Result := 'AMX Mod X Installer - Uploading with ' + FloatToStr(RoundTo(eOld / 1024, -2)) + ' kb/s';
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetAllFiles(Mask: String; Attr: Integer; Recursive: Boolean; ShowDirs: Boolean; ShowPath: Boolean = True): TStringList;
|
||||
var eSearch: TSearchRec;
|
||||
begin
|
||||
Result := TStringList.Create;
|
||||
|
||||
// Find all files
|
||||
if FindFirst(Mask, Attr, eSearch) = 0 then
|
||||
begin
|
||||
repeat
|
||||
if eSearch.Name[1] <> '.' then begin
|
||||
if ShowPath then begin
|
||||
if ((eSearch.Attr and Attr) = eSearch.Attr) and ((eSearch.Attr and faDirectory) <> eSearch.Attr) then
|
||||
Result.Add(ExtractFilePath(Mask) + eSearch.Name)
|
||||
else if (ShowDirs) and ((eSearch.Attr and faDirectory) = eSearch.Attr) then
|
||||
Result.Add(ExtractFilePath(Mask) + eSearch.Name);
|
||||
end
|
||||
else begin
|
||||
if ((eSearch.Attr and Attr) = eSearch.Attr) and ((eSearch.Attr and faDirectory) <> eSearch.Attr) then
|
||||
Result.Add(eSearch.Name)
|
||||
else if (ShowDirs) and ((eSearch.Attr and faDirectory) = eSearch.Attr) then
|
||||
Result.Add(eSearch.Name);
|
||||
end;
|
||||
|
||||
if ((eSearch.Attr and faDirectory) = eSearch.Attr) and (Recursive) then begin
|
||||
with GetAllFiles(ExtractFilePath(Mask) + eSearch.Name + '\' + ExtractFileName(Mask), Attr, True, ShowDirs, ShowPath) do begin
|
||||
Result.Text := Result.Text + Text;
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
until FindNext(eSearch) <> 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
function GetAllDirs: TStringList;
|
||||
var eList: TStringList;
|
||||
i: integer;
|
||||
begin
|
||||
eList := TStringList.Create;
|
||||
frmMain.IdFTP.List(eList);
|
||||
frmMain.IdFTP.DirectoryListing.LoadList(eList);
|
||||
eList.Clear;
|
||||
for i := 0 to frmMain.IdFTP.DirectoryListing.Count -1 do begin
|
||||
if frmMain.IdFTP.DirectoryListing.Items[i].ItemType = ditDirectory then
|
||||
eList.Add(frmMain.IdFTP.DirectoryListing.Items[i].FileName);
|
||||
end;
|
||||
Result := eList;
|
||||
end;
|
||||
|
||||
{ This is another possibility I coded because I couldn't find another bug...
|
||||
|
||||
function GetAllDirs: TStringList;
|
||||
var eList: TStringList;
|
||||
i, eStart: integer;
|
||||
begin
|
||||
eList := TStringList.Create;
|
||||
frmMain.IdFTP.List(eList, '', True);
|
||||
eStart := 0;
|
||||
|
||||
|
||||
// +----------------------------------------------------------------+
|
||||
// | drwxr-xr-x 5 web3 ftponly 2048 Jun 25 19:43 files |
|
||||
// | drwxr-xr-x 2 web3 ftponly 2048 Jun 25 19:57 html |
|
||||
// | drwxr-xr-x 3 root root 2048 Jun 20 05:03 log |
|
||||
// | drwxrwxrwx 2 web3 ftponly 2048 Jun 19 2004 phptmp |
|
||||
// +----------------------------------------------------------------+
|
||||
|
||||
|
||||
// at first remove all non-directories from the list
|
||||
for i := eList.Count -1 downto 0 do begin
|
||||
if Pos('d', eList[i]) <> 1 then
|
||||
eList.Delete(i);
|
||||
end;
|
||||
// then we have to find the position where ALL filenames start...
|
||||
for i := 0 to eList.Count -1 do begin
|
||||
if (eStart = 0) and (Pos(':', eList[i]) <> 0) then
|
||||
eStart := Pos(':', eList[i]);
|
||||
end;
|
||||
|
||||
if eStart = 0 then
|
||||
eList.Clear
|
||||
else begin
|
||||
// find the position
|
||||
for i := 0 to eList.Count -1 do begin
|
||||
if Pos(':', eList[i]) <> 0 then begin
|
||||
while (eStart <> Length(eList[i])) and (eList[i][eStart] <> #32) do
|
||||
Inc(eStart, 1);
|
||||
end;
|
||||
end;
|
||||
// remove the detail stuff...
|
||||
for i := 0 to eList.Count -1 do
|
||||
eList[i] := Copy(eList[i], eStart +1, Length(eList[i]));
|
||||
end;
|
||||
|
||||
Result := eList;
|
||||
end; }
|
||||
|
||||
end.
|
||||
|
||||
|
643
installer/installer/UnitInstall.pas
Executable file
643
installer/installer/UnitInstall.pas
Executable file
|
@ -0,0 +1,643 @@
|
|||
unit UnitInstall;
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils, Classes, Windows, Graphics, Forms, ShellAPI, Controls, Messages,
|
||||
TlHelp32, IdFTPCommon, ComCtrls;
|
||||
|
||||
type TMod = (modNone, modCS, modDoD, modTFC, modNS, modTS, modESF);
|
||||
type TOS = (osWindows, osLinux32, osLinux64);
|
||||
|
||||
procedure AddStatus(Text: String; Color: TColor; ShowTime: Boolean = True);
|
||||
procedure AddDone(Additional: String = '');
|
||||
function DelDir(Dir: string): Boolean;
|
||||
procedure MakeDir(Dir: String);
|
||||
procedure DownloadFile(eFile: String; eDestination: String);
|
||||
|
||||
procedure BasicInstallation(ePath: String; eMod: TMod; SteamInstall: Boolean; OS: TOS);
|
||||
procedure InstallDedicated(eModPath: String; eMod: TMod; UseSteam: Boolean);
|
||||
procedure InstallListen(ePath: String; eMod: TMod);
|
||||
procedure InstallCustom(ePath: String; eMod: TMod; eOS: TOS);
|
||||
procedure InstallFTP(eMod: TMod; OS: TOS);
|
||||
|
||||
var StartTime: TDateTime;
|
||||
SteamPath: String;
|
||||
StandaloneServer: String;
|
||||
Cancel: Boolean = False;
|
||||
|
||||
FileList: TStringList;
|
||||
DirList: TStringList;
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitfrmMain, UnitfrmProxy, UnitFunctions, UnitScanMods;
|
||||
|
||||
// useful stuff
|
||||
|
||||
function InstallTime: String;
|
||||
begin
|
||||
Result := TimeToStr(Now - StartTime);
|
||||
end;
|
||||
|
||||
procedure AddStatus(Text: String; Color: TColor; ShowTime: Boolean = True);
|
||||
begin
|
||||
frmMain.rtfDetails.SelStart := Length(frmMain.rtfDetails.Text);
|
||||
if ShowTime then begin
|
||||
frmMain.rtfDetails.SelAttributes.Color := clBlack;
|
||||
if frmMain.rtfDetails.Text = '' then
|
||||
frmMain.rtfDetails.SelText := '[' + InstallTime + '] '
|
||||
else
|
||||
frmMain.rtfDetails.SelText := #13#10 + '[' + InstallTime + '] ';
|
||||
frmMain.rtfDetails.SelStart := Length(frmMain.rtfDetails.Text);
|
||||
end
|
||||
else
|
||||
frmMain.rtfDetails.SelText := #13#10;
|
||||
|
||||
frmMain.rtfDetails.SelStart := Length(frmMain.rtfDetails.Text);
|
||||
frmMain.rtfDetails.SelAttributes.Color := Color;
|
||||
frmMain.rtfDetails.SelText := Text;
|
||||
frmMain.rtfDetails.Perform(WM_VSCROLL, SB_BOTTOM, 0);
|
||||
|
||||
frmMain.Repaint;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
procedure AddDone(Additional: String = '');
|
||||
begin
|
||||
frmMain.rtfDetails.SelStart := Length(frmMain.rtfDetails.Text);
|
||||
frmMain.rtfDetails.SelAttributes.Color := clGreen;
|
||||
if Additional = '' then
|
||||
frmMain.rtfDetails.SelText := ' Done.'
|
||||
else
|
||||
frmMain.rtfDetails.SelText := ' Done, ' + Additional + '.';
|
||||
frmMain.rtfDetails.Perform(WM_VSCROLL, SB_BOTTOM, 0);
|
||||
|
||||
frmMain.Repaint;
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
function DelDir(Dir: string): Boolean;
|
||||
var Fos: TSHFileOpStruct;
|
||||
begin
|
||||
ZeroMemory(@Fos, SizeOf(Fos));
|
||||
with Fos do begin
|
||||
wFunc := FO_DELETE;
|
||||
fFlags := FOF_SILENT or FOF_NOCONFIRMATION;
|
||||
pFrom := PChar(Dir + #0);
|
||||
end;
|
||||
Result := (ShFileOperation(fos) = 0);
|
||||
end;
|
||||
|
||||
procedure MakeDir(Dir: String);
|
||||
begin
|
||||
try
|
||||
if not DirectoryExists(Dir) then
|
||||
ForceDirectories(Dir);
|
||||
except
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure FileCopy(Source, Destination: String; CopyConfig: Boolean);
|
||||
begin
|
||||
if (not CopyConfig) and (Pos('config', Source) <> 0) then
|
||||
exit;
|
||||
if not FileExists(Source) then
|
||||
exit;
|
||||
|
||||
if FileExists(Destination) then begin
|
||||
try
|
||||
DeleteFile(PChar(Destination));
|
||||
except
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
try
|
||||
CopyFile(PChar(Source), PChar(Destination), False);
|
||||
except
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DownloadFile(eFile: String; eDestination: String);
|
||||
var TransferType: TIdFTPTransferType;
|
||||
begin
|
||||
// much better when files are transfered with the correct transfer type...
|
||||
TransferType := ftBinary;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.txt' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.cfg' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.ini' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.sma' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.inc' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.gam' then TransferType := ftASCII;
|
||||
if frmMain.IdFTP.TransferType <> TransferType then
|
||||
frmMain.IdFTP.TransferType := TransferType;
|
||||
// download the file
|
||||
frmMain.IdFTP.Get(eFile, eDestination, True);
|
||||
end;
|
||||
|
||||
procedure UploadFile(eFile: String; eDestination: String; CopyConfig: Boolean = True);
|
||||
var TransferType: TIdFTPTransferType;
|
||||
begin
|
||||
if Pos('config', eFile) > 0 then exit;
|
||||
eDestination := StringReplace(eDestination, '\', '/', [rfReplaceAll]);
|
||||
|
||||
// the same as in DownloadFile()
|
||||
TransferType := ftBinary;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.txt' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.cfg' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.ini' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.sma' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.inc' then TransferType := ftASCII;
|
||||
if ExtractFileExt(LowerCase(eFile)) = '.gam' then TransferType := ftASCII;
|
||||
if frmMain.IdFTP.TransferType <> TransferType then
|
||||
frmMain.IdFTP.TransferType := TransferType;
|
||||
// upload the file
|
||||
frmMain.IdFTP.Put(eFile, eDestination);
|
||||
end;
|
||||
|
||||
procedure FTPMakeDir(eDir: String);
|
||||
begin
|
||||
eDir := StringReplace(eDir, '\', '/', [rfReplaceAll]);
|
||||
try
|
||||
frmMain.IdFTP.MakeDir(eDir);
|
||||
except
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
end;
|
||||
|
||||
function FSize(eFile: String): Cardinal;
|
||||
var eRec: TSearchRec;
|
||||
begin
|
||||
if FindFirst(eFile, faAnyFile, eRec) = 0 then
|
||||
Result := eRec.Size
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function IsForbidden(eFile: String; eOS: TOS): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
case eOS of
|
||||
osWindows: begin
|
||||
if ExtractFileExt(eFile) = '.so' then
|
||||
Result := True;
|
||||
end;
|
||||
osLinux32: begin
|
||||
if ExtractFileExt(eFile) = '.dll' then
|
||||
Result := True;
|
||||
if ExtractFileExt(eFile) = '.exe' then
|
||||
Result := True;
|
||||
|
||||
if Pos('_amd64', ExtractFileName(eFile)) <> 0 then
|
||||
Result := True;
|
||||
end;
|
||||
osLinux64: begin
|
||||
if ExtractFileExt(eFile) = '.dll' then
|
||||
Result := True;
|
||||
if ExtractFileExt(eFile) = '.exe' then
|
||||
Result := True;
|
||||
|
||||
if Pos('_i386', ExtractFileName(eFile)) <> 0 then
|
||||
Result := True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// stuff for killing processes
|
||||
|
||||
function GetProcessID(sProcName: String): Integer;
|
||||
var
|
||||
hProcSnap: THandle;
|
||||
pe32: TProcessEntry32;
|
||||
begin
|
||||
result := -1;
|
||||
hProcSnap := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
|
||||
if hProcSnap = INVALID_HANDLE_VALUE then
|
||||
exit;
|
||||
|
||||
pe32.dwSize := SizeOf(ProcessEntry32);
|
||||
if Process32First(hProcSnap, pe32) = true then begin
|
||||
while Process32Next(hProcSnap, pe32) = true do begin
|
||||
if pos(sProcName, pe32.szExeFile) <> 0then
|
||||
result := pe32.th32ProcessID;
|
||||
end;
|
||||
end;
|
||||
CloseHandle(hProcSnap);
|
||||
end;
|
||||
|
||||
procedure KillProcess(dwProcID: DWORD);
|
||||
var
|
||||
hProcess : Cardinal;
|
||||
dw : DWORD;
|
||||
begin
|
||||
hProcess := OpenProcess(SYNCHRONIZE or PROCESS_TERMINATE, False, dwProcID);
|
||||
TerminateProcess(hProcess, 0);
|
||||
dw := WaitForSingleObject(hProcess, 5000);
|
||||
case dw of
|
||||
WAIT_TIMEOUT: begin
|
||||
CloseHandle(hProcess);
|
||||
exit;
|
||||
end;
|
||||
WAIT_FAILED: begin
|
||||
RaiseLastOSError;
|
||||
CloseHandle(hProcess);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
CloseHandle(hProcess);
|
||||
end;
|
||||
|
||||
// Installation here
|
||||
|
||||
{ Basic Installation }
|
||||
|
||||
procedure BasicInstallation(ePath: String; eMod: TMod; SteamInstall: Boolean; OS: TOS);
|
||||
var eStr: TStringList;
|
||||
i: integer;
|
||||
CopyConfig: Boolean;
|
||||
begin
|
||||
AddStatus('Scanning for directories...', clBlack);
|
||||
with GetAllFiles(ExtractFilePath(ParamStr(0)) + 'files\*.*', faDirectory, True, True) do begin
|
||||
DirList.Text := Text;
|
||||
Free;
|
||||
end;
|
||||
AddDone('found ' + IntToStr(DirList.Count) + ' directories..');
|
||||
AddStatus('Scanning for files...', clBlack);
|
||||
with GetAllFiles(ExtractFilePath(ParamStr(0)) + 'files\*.*', faAnyFile, True, False) do begin
|
||||
FileList.Text := Text;
|
||||
Free;
|
||||
end;
|
||||
AddDone('found ' + IntToStr(FileList.Count) + ' files..');
|
||||
AddStatus('', clBlack, False);
|
||||
|
||||
frmMain.ggeAll.MaxValue := DirList.Count + FileList.Count;
|
||||
frmMain.ggeItem.MaxValue := DirList.Count;
|
||||
|
||||
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 AMX Mod X. 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
|
||||
AddDone
|
||||
else
|
||||
KillProcess(GetProcessID('Steam.exe'));
|
||||
while GetProcessID('Steam.exe') <> -1 do begin // sure is sure...
|
||||
Sleep(50);
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
AddDone;
|
||||
end
|
||||
else begin
|
||||
Application.Terminate;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
CopyConfig := True;
|
||||
if DirectoryExists(ePath + 'addons\amxmodx') then begin
|
||||
case MessageBox(frmMain.Handle, 'An AMX Mod X 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;
|
||||
mrCancel: begin
|
||||
Application.Terminate;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
for i := 0 to DirList.Count -1 do
|
||||
DirList[i] := Copy(DirList[i], Length(ExtractFilePath(ParamStr(0))) + 7, Length(DirList[i]));
|
||||
for i := 0 to FileList.Count -1 do
|
||||
FileList[i] := Copy(FileList[i], Length(ExtractFilePath(ParamStr(0))) + 7, Length(FileList[i]));
|
||||
|
||||
{ liblist.gam }
|
||||
if not FileExists(ePath + 'liblist.gam') then begin
|
||||
if MessageBox(frmMain.Handle, 'The file "liblist.gam" couldn''t be found. Continue installation?', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNO) = mrNo then begin
|
||||
AddStatus('Installation canceled by user!', clRed, False);
|
||||
Screen.Cursor := crDefault;
|
||||
Cancel := True;
|
||||
exit;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
AddStatus('Editing liblist.gam...', clBlack);
|
||||
eStr := TStringList.Create;
|
||||
eStr.LoadFromFile(ePath + 'liblist.gam');
|
||||
if eStr.IndexOf('gamedll "addons\metamod\dlls\metamod.dll"') = -1 then begin
|
||||
for i := 0 to eStr.Count -1 do begin
|
||||
if Pos('gamedll', TrimLeft(eStr[i])) = 1 then
|
||||
eStr[i] := '//' + eStr[i];
|
||||
end;
|
||||
eStr.Add('gamedll "addons\metamod\dlls\metamod.dll"');
|
||||
eStr.Add('gamedll_linux "addons/metamod/dlls/metamod_i386.so"');
|
||||
FileSetAttr(ePath + 'liblist.gam', 0);
|
||||
eStr.SaveToFile(ePath + 'liblist.gam');
|
||||
FileSetAttr(ePath + 'liblist.gam', faReadOnly); // important for listen servers
|
||||
end;
|
||||
eStr.Free;
|
||||
AddDone;
|
||||
{ create directories }
|
||||
AddStatus('Creating directories...', clBlack);
|
||||
end;
|
||||
// metamod...
|
||||
MakeDir(ePath + 'addons');
|
||||
MakeDir(ePath + 'addons\amxmodx');
|
||||
MakeDir(ePath + 'addons\metamod');
|
||||
MakeDir(ePath + 'addons\metamod\dlls');
|
||||
// rest...
|
||||
for i := 0 to DirList.Count -1 do begin
|
||||
if Cancel then
|
||||
exit;
|
||||
|
||||
if Pos('base', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 6, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 6, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
case eMod of
|
||||
modCS: begin
|
||||
if Pos('cstrike', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 9, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 9, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modDoD: begin
|
||||
if Pos('dod', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 5, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 5, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modTFC: begin
|
||||
if Pos('tfc', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 5, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 5, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modNS: begin
|
||||
if Pos('ns', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 4, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 4, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modTS: begin
|
||||
if Pos('ts', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 4, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 4, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modESF: begin
|
||||
if Pos('esforce', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 4, Length(DirList[i])));
|
||||
AddStatus('Created directory: addons\amxmodx\' + Copy(DirList[i], 4, Length(DirList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
frmMain.ggeAll.Progress := i;
|
||||
frmMain.ggeItem.Progress := i;
|
||||
end;
|
||||
frmMain.ggeItem.MaxValue := FileList.Count;
|
||||
{ copy all files }
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Copying files...', clBlack);
|
||||
for i := 0 to FileList.Count -1 do begin
|
||||
if Cancel then
|
||||
exit;
|
||||
|
||||
if not IsForbidden(FileList[i], OS) then begin
|
||||
if Pos('base', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 6, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 6, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
case eMod of
|
||||
modCS: begin
|
||||
if Pos('cstrike', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 9, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 9, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modDoD: begin
|
||||
if Pos('dod', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 5, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 5, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modTFC: begin
|
||||
if Pos('tfc', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 5, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 5, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modNS: begin
|
||||
if Pos('ns', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 4, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 4, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modTS: begin
|
||||
if Pos('ts', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 4, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 4, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
modESF: begin
|
||||
if Pos('esforce', FileList[i]) = 1 then begin
|
||||
FileCopy(ExtractFilePath(ParamStr(0)) + 'files\' + FileList[i], ePath + 'addons\amxmodx\' + Copy(FileList[i], 4, Length(FileList[i])), CopyConfig);
|
||||
AddStatus('Copied file: addons\amxmodx\' + Copy(FileList[i], 4, Length(FileList[i])), clBlack);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
frmMain.ggeAll.Progress := frmMain.ggeAll.Progress + 1;
|
||||
frmMain.ggeItem.Progress := i;
|
||||
end;
|
||||
{ metamod }
|
||||
FileCopy(ePath + 'addons\amxmodx\dlls\metamod.dll', ePath + '\addons\metamod\dlls\metamod.dll', CopyConfig);
|
||||
FileCopy(ePath + '\addons\amxmodx\dlls\metamod_i386.so', ePath + '\addons\metamod\dlls\metamod_i386.so', CopyConfig);
|
||||
FileCopy(ePath + '\addons\amxmodx\dlls\metamod_amd64.so', ePath + '\addons\metamod\dlls\metamod_amd64.so', CopyConfig);
|
||||
try
|
||||
if FileExists(ePath + '\addons\amxmodx\dlls\metamod.dll') then DeleteFile(PChar(ePath + '\addons\amxmodx\dlls\metamod.dll'));
|
||||
if FileExists(ePath + '\addons\amxmodx\dlls\metamod_amd64.so') then DeleteFile(PChar(ePath + '\addons\amxmodx\dlls\metamod_amd64.so'));
|
||||
if FileExists(ePath + '\addons\amxmodx\dlls\metamod_i386.so') then DeleteFile(PChar(ePath + '\addons\amxmodx\dlls\metamod_i386.so'));
|
||||
finally
|
||||
eStr := TStringList.Create;
|
||||
eStr.Add(';;Metamod plugins.ini');
|
||||
eStr.Add(';;AMX Mod X 1.1');
|
||||
if OS = osWindows then
|
||||
eStr.Add('win32 addons\amxmodx\dlls\amxmodx_mm.dll')
|
||||
else if OS = osLinux32 then
|
||||
eStr.Add('linux addons/amxmodx/dlls/metamod_i386.so')
|
||||
else
|
||||
eStr.Add('linux addons/amxmodx/dlls/metamod_amd64.so');
|
||||
eStr.SaveToFile(ePath + 'addons\metamod\plugins.ini');
|
||||
eStr.Free;
|
||||
end;
|
||||
|
||||
// finish...
|
||||
frmMain.ggeAll.Progress := frmMain.ggeAll.MaxValue;
|
||||
frmMain.ggeItem.Progress := frmMain.ggeItem.MaxValue;
|
||||
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Finished installation!', clBlack, False);
|
||||
frmMain.cmdNext.Enabled := True;
|
||||
frmMain.cmdCancel.Hide;
|
||||
|
||||
Screen.Cursor := crDefault;
|
||||
end;
|
||||
|
||||
{ Dedicated Server }
|
||||
|
||||
procedure InstallDedicated(eModPath: String; eMod: TMod; UseSteam: Boolean);
|
||||
begin
|
||||
StartTime := Now;
|
||||
Screen.Cursor := crHourGlass;
|
||||
AddStatus('Starting installation on dedicated server...', clBlack);
|
||||
BasicInstallation(eModPath, eMod, UseSteam, osWindows);
|
||||
end;
|
||||
|
||||
{ Listen Server }
|
||||
|
||||
procedure InstallListen(ePath: String; eMod: TMod);
|
||||
begin
|
||||
StartTime := Now;
|
||||
Screen.Cursor := crHourGlass;
|
||||
AddStatus('Starting installation on the listen server...', clBlack);
|
||||
BasicInstallation(ePath, eMod, True, osWindows);
|
||||
end;
|
||||
|
||||
{ Custom mod }
|
||||
|
||||
procedure InstallCustom(ePath: String; eMod: TMod; eOS: TOS);
|
||||
begin
|
||||
StartTime := Now;
|
||||
Screen.Cursor := crHourGlass;
|
||||
AddStatus('Starting AMX Mod X installation...', clBlack);
|
||||
BasicInstallation(ePath, eMod, False, eOS);
|
||||
end;
|
||||
|
||||
{ FTP }
|
||||
|
||||
procedure InstallFTP(eMod: TMod; OS: TOS);
|
||||
var eStr: TStringList;
|
||||
i: integer;
|
||||
ePath: String;
|
||||
CurNode: TTreeNode;
|
||||
begin
|
||||
frmMain.cmdCancel.Show;
|
||||
frmMain.cmdNext.Hide;
|
||||
Screen.Cursor := crHourGlass;
|
||||
AddStatus('Scanning for directories...', clBlack);
|
||||
with GetAllFiles(ExtractFilePath(ParamStr(0)) + 'temp\*.*', faDirectory, True, True) do begin
|
||||
DirList.Text := Text;
|
||||
Free;
|
||||
end;
|
||||
AddDone('found ' + IntToStr(DirList.Count) + ' directories..');
|
||||
AddStatus('Scanning for files...', clBlack);
|
||||
with GetAllFiles(ExtractFilePath(ParamStr(0)) + 'temp\*.*', faAnyFile, True, False) do begin
|
||||
FileList.Text := Text;
|
||||
Free;
|
||||
end;
|
||||
AddDone('found ' + IntToStr(FileList.Count) + ' files..');
|
||||
AddStatus('', clBlack, False);
|
||||
|
||||
frmMain.ggeAll.MaxValue := DirList.Count + FileList.Count;
|
||||
frmMain.ggeItem.MaxValue := DirList.Count;
|
||||
|
||||
for i := 0 to DirList.Count -1 do
|
||||
DirList[i] := Copy(DirList[i], Length(ExtractFilePath(ParamStr(0))) + 6, Length(DirList[i]));
|
||||
for i := 0 to FileList.Count -1 do
|
||||
FileList[i] := Copy(FileList[i], Length(ExtractFilePath(ParamStr(0))) + 6, Length(FileList[i]));
|
||||
|
||||
// liblist.gam
|
||||
AddStatus('Editing liblist.gam...', clBlack);
|
||||
eStr := TStringList.Create;
|
||||
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
|
||||
if eStr.IndexOf('gamedll "addons\metamod\dlls\metamod.dll"') = -1 then begin
|
||||
if Cancel then
|
||||
exit;
|
||||
|
||||
for i := 0 to eStr.Count -1 do begin
|
||||
if Pos('gamedll', TrimLeft(eStr[i])) = 1 then
|
||||
eStr[i] := '//' + eStr[i];
|
||||
end;
|
||||
if frmMain.optWindows.Checked then
|
||||
eStr.Add('gamedll "addons\metamod\dlls\metamod.dll"')
|
||||
else if frmMain.optLinux32.Checked then
|
||||
eStr.Add('gamedll_linux "addons/metamod/dlls/metamod_i386.so"')
|
||||
else
|
||||
eStr.Add('gamedll_linux "addons/metamod/dlls/metamod_amd64.so"');
|
||||
FileSetAttr(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam', 0);
|
||||
eStr.SaveToFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
|
||||
end;
|
||||
eStr.Free;
|
||||
AddDone;
|
||||
|
||||
ePath := '/';
|
||||
CurNode := frmMain.trvDirectories.Selected;
|
||||
repeat
|
||||
ePath := '/' + CurNode.Text + ePath;
|
||||
CurNode := CurNode.Parent;
|
||||
until (not Assigned(CurNode));
|
||||
|
||||
{ create directories }
|
||||
AddStatus('Creating directories...', clBlack);
|
||||
// rest...
|
||||
for i := 0 to DirList.Count -1 do begin
|
||||
if Cancel then
|
||||
exit;
|
||||
|
||||
FTPMakeDir(ePath + DirList[i]);
|
||||
AddStatus('Created directory: ' + DirList[i], clBlack);
|
||||
|
||||
frmMain.ggeAll.Progress := i;
|
||||
frmMain.ggeItem.Progress := i;
|
||||
end;
|
||||
{ upload files }
|
||||
frmMain.tmrSpeed.Enabled := True;
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Uploading files...', clBlack);
|
||||
AddStatus('', clBlack, False);
|
||||
for i := 0 to FileList.Count -1 do begin
|
||||
if Cancel then
|
||||
exit;
|
||||
|
||||
if (not IsForbidden(FileList[i], OS)) and (FileExists(ExtractFilePath(ParamStr(0)) + 'temp\' + FileList[i])) then begin
|
||||
AddStatus('Uploading file: ' + FileList[i], clBlack);
|
||||
frmMain.ggeItem.MaxValue := FSize(ExtractFilePath(ParamStr(0)) + 'temp\' + FileList[i]);
|
||||
try
|
||||
if LowerCase(FileList[i]) = 'liblist.gam' then
|
||||
frmMain.IdFTP.Site('CHMOD 744 ' + FileList[i]);
|
||||
UploadFile(ExtractFilePath(ParamStr(0)) + 'temp\' + FileList[i], ePath + FileList[i], True);
|
||||
if LowerCase(FileList[i]) = 'liblist.gam' then
|
||||
frmMain.IdFTP.Size('CHMOD 444 ' + FileList[i]);
|
||||
except
|
||||
on E: Exception do begin
|
||||
if not Cancel then
|
||||
MessageBox(frmMain.Handle, PChar('An error occured while uploading "' + FileList[i] + '"!' + #13 + E.Message), PChar(frmMain.Caption), MB_ICONSTOP);
|
||||
Screen.Cursor := crDefault;
|
||||
Application.Terminate;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
AddDone;
|
||||
end;
|
||||
frmMain.ggeAll.Progress := frmMain.ggeAll.Progress + 1;
|
||||
frmMain.ggeItem.Progress := i;
|
||||
end;
|
||||
frmMain.ggeAll.Progress := frmMain.ggeAll.MaxValue;
|
||||
frmMain.ggeItem.Progress := frmMain.ggeItem.MaxValue;
|
||||
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Finished installation!', clBlack, False);
|
||||
DelDir(ExtractFilePath(ParamStr(0)) + 'temp');
|
||||
frmMain.tmrSpeed.Enabled := False;
|
||||
|
||||
Screen.Cursor := crDefault;
|
||||
frmMain.cmdNext.Enabled := True;
|
||||
frmMain.cmdCancel.Hide;
|
||||
frmMain.cmdNext.Show;
|
||||
frmMain.tmrSpeed.Enabled := False;
|
||||
frmMain.Caption := Application.Title;
|
||||
end;
|
||||
|
||||
end.
|
253
installer/installer/UnitScanMods.pas
Executable file
253
installer/installer/UnitScanMods.pas
Executable file
|
@ -0,0 +1,253 @@
|
|||
unit UnitScanMods;
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils, Classes, Dialogs;
|
||||
|
||||
function GetAllMods(eBaseDir: String; eSearchNames: Boolean): String;
|
||||
function GetModPathName(eMod: String): String;
|
||||
function ModIndex(Name: String; CheckName: Boolean): Integer;
|
||||
|
||||
var eMods: TStringList;
|
||||
eModsPath: TStringList;
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitFunctions;
|
||||
|
||||
// functions
|
||||
|
||||
function GetAllMods(eBaseDir: String; eSearchNames: Boolean): String;
|
||||
var i: integer;
|
||||
eDirectories: TStringList;
|
||||
begin
|
||||
eBaseDir := IncludeTrailingPathDelimiter(eBaseDir);
|
||||
eDirectories := GetAllFiles(eBaseDir + '*.*', faDirectory, False, True, False);
|
||||
|
||||
if eDirectories.Count <> 0 then begin
|
||||
for i := eDirectories.Count -1 downto 0 do begin
|
||||
if (ModIndex(eDirectories[i], True) = -1) then
|
||||
eDirectories.Delete(i)
|
||||
else
|
||||
eDirectories[i] := eMods[ModIndex(eDirectories[i], True)];
|
||||
end;
|
||||
Result := eDirectories.Text;
|
||||
end
|
||||
else
|
||||
Result := '';
|
||||
eDirectories.Free;
|
||||
end;
|
||||
|
||||
function GetModPathName(eMod: String): String;
|
||||
var i: integer;
|
||||
begin
|
||||
Result := '';
|
||||
for i := 0 to eMods.Count -1 do begin
|
||||
if LowerCase(eMod) = LowerCase(eMods[i]) then begin
|
||||
Result := eModsPath[i];
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function ModIndex(Name: String; CheckName: Boolean): Integer;
|
||||
var i: integer;
|
||||
begin
|
||||
Result := -1;
|
||||
for i := 0 to eMods.Count -1 do begin
|
||||
if (LowerCase(eModsPath[i]) = LowerCase(Name)) then begin
|
||||
Result := i;
|
||||
break;
|
||||
end
|
||||
else if (LowerCase(eMods[i]) = LowerCase(Name)) and (CheckName) then begin
|
||||
Result := i;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// misc...
|
||||
|
||||
initialization
|
||||
|
||||
// Create objects on start
|
||||
eMods := TStringList.Create;
|
||||
eModsPath := TStringList.Create;
|
||||
// Add mods ...
|
||||
eMods.Add('Action Half-Life');
|
||||
eMods.Add('Adrenaline Gamer Steam');
|
||||
eMods.Add('Adrenalinegamer 3.x');
|
||||
eMods.Add('Adrenalinegamer 4.x');
|
||||
eMods.Add('Arg!');
|
||||
eMods.Add('Azure Sheep');
|
||||
eMods.Add('The Battle Grounds');
|
||||
eMods.Add('Bot');
|
||||
eMods.Add('Bumper Cars');
|
||||
eMods.Add('BuzzyBots');
|
||||
eMods.Add('Counter-Strike 1.3');
|
||||
eMods.Add('Counter-Strike');
|
||||
eMods.Add('CS 1.5 for Steam');
|
||||
eMods.Add('Condition Zero');
|
||||
eMods.Add('Desert Crisis');
|
||||
eMods.Add('Deathmatch Classic');
|
||||
eMods.Add('Day of Defeat');
|
||||
eMods.Add('Digital Paintball');
|
||||
eMods.Add('Dragon Mod Z');
|
||||
eMods.Add('Earth''s Special Forces');
|
||||
eMods.Add('Existence');
|
||||
eMods.Add('Firearms');
|
||||
eMods.Add('Retro Firearms');
|
||||
eMods.Add('Freeze');
|
||||
eMods.Add('Frontline Force');
|
||||
eMods.Add('GangstaWars');
|
||||
eMods.Add('Gangwars');
|
||||
eMods.Add('Opposing Force');
|
||||
eMods.Add('Global Warfare');
|
||||
eMods.Add('Goldeneye');
|
||||
eMods.Add('HL-Rally');
|
||||
eMods.Add('Holy Wars');
|
||||
eMods.Add('Hostile Intent');
|
||||
eMods.Add('International Online Soccer');
|
||||
eMods.Add('Judgement');
|
||||
eMods.Add('Kanonball');
|
||||
eMods.Add('Monkeystrike');
|
||||
eMods.Add('Morbid Inclination');
|
||||
eMods.Add('Natural Selection');
|
||||
eMods.Add('Natural Selection Beta');
|
||||
eMods.Add('OeL Half-Life');
|
||||
eMods.Add('Over Ground');
|
||||
eMods.Add('Outlawsmod');
|
||||
eMods.Add('Operations 1942');
|
||||
eMods.Add('Open-Source Jailbreak');
|
||||
eMods.Add('Out Break');
|
||||
eMods.Add('Oz Deathmatch');
|
||||
eMods.Add('Paintball');
|
||||
eMods.Add('Public Enemy');
|
||||
eMods.Add('Phineas Bot');
|
||||
eMods.Add('Point of No Return');
|
||||
eMods.Add('Pirates, Vikings and Knights');
|
||||
eMods.Add('Rocket Crowbar 2');
|
||||
eMods.Add('Retro Counter-Strike');
|
||||
eMods.Add('Gunman Chronicles');
|
||||
eMods.Add('Ricochet');
|
||||
eMods.Add('Rocket Crowbar');
|
||||
eMods.Add('Rival Species');
|
||||
eMods.Add('Scientist Hunt');
|
||||
eMods.Add('The Ship');
|
||||
eMods.Add('Science & Industry');
|
||||
eMods.Add('Snow-War');
|
||||
eMods.Add('StargateTC');
|
||||
eMods.Add('Sven Coop');
|
||||
eMods.Add('Swarm');
|
||||
eMods.Add('Team Fortress Classic');
|
||||
eMods.Add('The Wastes');
|
||||
eMods.Add('Project Timeless');
|
||||
eMods.Add('Tour of Duty');
|
||||
eMods.Add('Train Hunters');
|
||||
eMods.Add('The Terrorist Revenge');
|
||||
eMods.Add('The Specialists');
|
||||
eMods.Add('The Specialists');
|
||||
eMods.Add('The Trenches');
|
||||
eMods.Add('Underworld Bloodline');
|
||||
eMods.Add('Half-Life Deathmatch');
|
||||
eMods.Add('VampireSlayer');
|
||||
eMods.Add('Wanted!');
|
||||
eMods.Add('Wasteland');
|
||||
eMods.Add('Weapon Wars');
|
||||
eMods.Add('Wizard Wars');
|
||||
eMods.Add('WormsHL');
|
||||
eMods.Add('Zombie Panic!');
|
||||
eMods.Add('Earth''s Special Forces');
|
||||
// ... and their pathes ...
|
||||
eModsPath.Add('action');
|
||||
eModsPath.Add('ag');
|
||||
eModsPath.Add('ag3');
|
||||
eModsPath.Add('aghl');
|
||||
eModsPath.Add('arg');
|
||||
eModsPath.Add('asheep');
|
||||
eModsPath.Add('bg');
|
||||
eModsPath.Add('bot');
|
||||
eModsPath.Add('bumpercars');
|
||||
eModsPath.Add('buzzybots');
|
||||
eModsPath.Add('cs13');
|
||||
eModsPath.Add('cstrike');
|
||||
eModsPath.Add('csv15');
|
||||
eModsPath.Add('czero');
|
||||
eModsPath.Add('dcrisis');
|
||||
eModsPath.Add('dmc');
|
||||
eModsPath.Add('dod');
|
||||
eModsPath.Add('dpb');
|
||||
eModsPath.Add('dragonmodz');
|
||||
eModsPath.Add('esf');
|
||||
eModsPath.Add('existence');
|
||||
eModsPath.Add('firearms');
|
||||
eModsPath.Add('firearms25');
|
||||
eModsPath.Add('freeze');
|
||||
eModsPath.Add('frontline');
|
||||
eModsPath.Add('gangstawars');
|
||||
eModsPath.Add('gangwars');
|
||||
eModsPath.Add('gearbox');
|
||||
eModsPath.Add('globalwarfare');
|
||||
eModsPath.Add('goldeneye');
|
||||
eModsPath.Add('hlrally');
|
||||
eModsPath.Add('holywars');
|
||||
eModsPath.Add('hostileintent');
|
||||
eModsPath.Add('ios');
|
||||
eModsPath.Add('judgedm');
|
||||
eModsPath.Add('kanonball');
|
||||
eModsPath.Add('monkeystrike');
|
||||
eModsPath.Add('MorbidPR');
|
||||
eModsPath.Add('ns');
|
||||
eModsPath.Add('nsp');
|
||||
eModsPath.Add('oel');
|
||||
eModsPath.Add('og');
|
||||
eModsPath.Add('ol');
|
||||
eModsPath.Add('ops1942');
|
||||
eModsPath.Add('osjb');
|
||||
eModsPath.Add('outbreak');
|
||||
eModsPath.Add('oz');
|
||||
eModsPath.Add('paintball');
|
||||
eModsPath.Add('penemy');
|
||||
eModsPath.Add('phineas');
|
||||
eModsPath.Add('ponreturn');
|
||||
eModsPath.Add('pvk');
|
||||
eModsPath.Add('rc2');
|
||||
eModsPath.Add('retrocs');
|
||||
eModsPath.Add('rewolf');
|
||||
eModsPath.Add('ricochet');
|
||||
eModsPath.Add('rockcrowbar');
|
||||
eModsPath.Add('rspecies');
|
||||
eModsPath.Add('scihunt');
|
||||
eModsPath.Add('Ship');
|
||||
eModsPath.Add('si');
|
||||
eModsPath.Add('snow');
|
||||
eModsPath.Add('stargatetc');
|
||||
eModsPath.Add('svencoop');
|
||||
eModsPath.Add('swarm');
|
||||
eModsPath.Add('tfc');
|
||||
eModsPath.Add('thewastes');
|
||||
eModsPath.Add('timeless');
|
||||
eModsPath.Add('tod');
|
||||
eModsPath.Add('trainhunters');
|
||||
eModsPath.Add('trevenge');
|
||||
eModsPath.Add('TS');
|
||||
eModsPath.Add('TS');
|
||||
eModsPath.Add('tt');
|
||||
eModsPath.Add('underworld');
|
||||
eModsPath.Add('valve');
|
||||
eModsPath.Add('vs');
|
||||
eModsPath.Add('wantedhl');
|
||||
eModsPath.Add('wasteland');
|
||||
eModsPath.Add('weapon_wars');
|
||||
eModsPath.Add('wizwars');
|
||||
eModsPath.Add('wormshl');
|
||||
eModsPath.Add('zp');
|
||||
eModsPath.Add('esforce');
|
||||
|
||||
finalization
|
||||
|
||||
// Free them...
|
||||
eMods.Free;
|
||||
eModsPath.Free;
|
||||
|
||||
end.
|
BIN
installer/installer/UnitSelectModPath.dfm
Executable file
BIN
installer/installer/UnitSelectModPath.dfm
Executable file
Binary file not shown.
28
installer/installer/UnitSelectModPath.pas
Executable file
28
installer/installer/UnitSelectModPath.pas
Executable file
|
@ -0,0 +1,28 @@
|
|||
unit UnitSelectModPath;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
||||
StdCtrls, ExtCtrls, Forms, FileCtrl, ComCtrls, ShellCtrls,
|
||||
TFlatComboBoxUnit, TFlatButtonUnit;
|
||||
|
||||
type
|
||||
TfrmSelectModPath = class(TForm)
|
||||
pnlDesign: TPanel;
|
||||
lblInfo: TLabel;
|
||||
trvDirectory: TShellTreeView;
|
||||
lblGameAddon: TLabel;
|
||||
cboGameAddon: TFlatComboBox;
|
||||
cmdOK: TFlatButton;
|
||||
cmdCancel: TFlatButton;
|
||||
end;
|
||||
|
||||
var
|
||||
frmSelectModPath: TfrmSelectModPath;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
end.
|
6640
installer/installer/UnitfrmMain.dfm
Executable file
6640
installer/installer/UnitfrmMain.dfm
Executable file
File diff suppressed because it is too large
Load Diff
719
installer/installer/UnitfrmMain.pas
Executable file
719
installer/installer/UnitfrmMain.pas
Executable file
|
@ -0,0 +1,719 @@
|
|||
unit UnitfrmMain;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, TFlatRadioButtonUnit, StdCtrls, ComCtrls, mxFlatControls, JvPageList,
|
||||
ExtCtrls, JvExControls, JvComponent, TFlatButtonUnit, jpeg, TFlatEditUnit,
|
||||
TFlatGaugeUnit, ImgList, FileCtrl, Registry, CheckLst, TFlatComboBoxUnit,
|
||||
TFlatCheckBoxUnit, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||
IdTCPClient, IdFTP, IdException, IdAntiFreezeBase, IdAntiFreeze;
|
||||
|
||||
type
|
||||
TfrmMain = class(TForm)
|
||||
jplWizard: TJvPageList;
|
||||
jspWelcome: TJvStandardPage;
|
||||
pnlButtons: TPanel;
|
||||
bvlSpace: TBevel;
|
||||
cmdNext: TFlatButton;
|
||||
cmdCancel: TFlatButton;
|
||||
imgInstall: TImage;
|
||||
lblWelcome: TLabel;
|
||||
lblInfo1: TLabel;
|
||||
lblInfo2: TLabel;
|
||||
lblInfo3: TLabel;
|
||||
jspLicense: TJvStandardPage;
|
||||
pnlLicense: TPanel;
|
||||
imgIcon1: TImage;
|
||||
lblTitle1: TLabel;
|
||||
lblSubTitle1: TLabel;
|
||||
freLicense: TmxFlatRichEdit;
|
||||
frbAgree: TFlatRadioButton;
|
||||
ftbDontAgree: TFlatRadioButton;
|
||||
jspInstallMethod: TJvStandardPage;
|
||||
pnlHeader2: TPanel;
|
||||
imgIcon2: TImage;
|
||||
lblTitle2: TLabel;
|
||||
lblSubTitle2: TLabel;
|
||||
lblInstallMethod: TLabel;
|
||||
pnlInstallMethod: TPanel;
|
||||
frbDedicatedServer: TFlatRadioButton;
|
||||
frbListenServer: TFlatRadioButton;
|
||||
frbSelectMod: TFlatRadioButton;
|
||||
frbFTP: TFlatRadioButton;
|
||||
cmdBack: TFlatButton;
|
||||
jspFTP: TJvStandardPage;
|
||||
pnlHeader3: TPanel;
|
||||
imgIcon3: TImage;
|
||||
lblTitle3: TLabel;
|
||||
lblSubTitle3: TLabel;
|
||||
lblStep1: TLabel;
|
||||
pnlFTPData: TPanel;
|
||||
lblHost: TLabel;
|
||||
txtHost: TFlatEdit;
|
||||
lblUserName: TLabel;
|
||||
txtUserName: TFlatEdit;
|
||||
txtPassword: TFlatEdit;
|
||||
lblPassword: TLabel;
|
||||
txtPort: TFlatEdit;
|
||||
lblPort: TLabel;
|
||||
lblStep2: TLabel;
|
||||
cmdConnect: TFlatButton;
|
||||
pnlDirectory: TPanel;
|
||||
trvDirectories: TTreeView;
|
||||
lblStep5: TLabel;
|
||||
jspInstallProgress: TJvStandardPage;
|
||||
pnlHeader5: TPanel;
|
||||
imgIcon5: TImage;
|
||||
lblTitle5: TLabel;
|
||||
lblSubTitle5: TLabel;
|
||||
ggeAll: TFlatGauge;
|
||||
lblProgress: TLabel;
|
||||
ggeItem: TFlatGauge;
|
||||
rtfDetails: TmxFlatRichEdit;
|
||||
lblDetails: TLabel;
|
||||
bvlSpace2: TBevel;
|
||||
ilImages: TImageList;
|
||||
bvlSpacer1: TBevel;
|
||||
bvlSpacer2: TBevel;
|
||||
bvlSpacer3: TBevel;
|
||||
bvlSpacer5: TBevel;
|
||||
jspSelectMod: TJvStandardPage;
|
||||
pnlSelectMod: TPanel;
|
||||
imgIcon6: TImage;
|
||||
lblSelectMod: TLabel;
|
||||
lblSelectModInfo: TLabel;
|
||||
bvlSelectMod: TBevel;
|
||||
lblInfo: TLabel;
|
||||
lstMods: TmxFlatListBox;
|
||||
chkPassive: TFlatCheckBox;
|
||||
lblStep3: TLabel;
|
||||
pnlOS: TPanel;
|
||||
optWindows: TFlatRadioButton;
|
||||
optLinux32: TFlatRadioButton;
|
||||
optLinux64: TFlatRadioButton;
|
||||
IdFTP: TIdFTP;
|
||||
cmdProxySettings: TFlatButton;
|
||||
IdAntiFreeze: TIdAntiFreeze;
|
||||
lblStep4: TLabel;
|
||||
cboGameAddon: TFlatComboBox;
|
||||
frbStandaloneServer: TFlatRadioButton;
|
||||
tmrSpeed: TTimer;
|
||||
procedure jvwStepsCancelButtonClick(Sender: TObject);
|
||||
procedure cmdCancelClick(Sender: TObject);
|
||||
procedure cmdNextClick(Sender: TObject);
|
||||
procedure CheckNext(Sender: TObject);
|
||||
procedure cmdBackClick(Sender: TObject);
|
||||
procedure cmdConnectClick(Sender: TObject);
|
||||
procedure jplWizardChange(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure lstModsClick(Sender: TObject);
|
||||
procedure cmdProxySettingsClick(Sender: TObject);
|
||||
procedure txtPortChange(Sender: TObject);
|
||||
procedure trvDirectoriesExpanded(Sender: TObject; Node: TTreeNode);
|
||||
procedure trvDirectoriesChange(Sender: TObject; Node: TTreeNode);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure IdFTPWork(Sender: TObject; AWorkMode: TWorkMode;
|
||||
const AWorkCount: Integer);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure tmrSpeedTimer(Sender: TObject);
|
||||
private
|
||||
OldProgress: Integer;
|
||||
CurrProgress: Integer;
|
||||
public
|
||||
procedure ExceptionHandler(Sender: TObject; E: Exception);
|
||||
end;
|
||||
|
||||
var
|
||||
frmMain: TfrmMain;
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitFunctions, UnitScanMods, UnitfrmProxy, UnitInstall,
|
||||
UnitSelectModPath;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmMain.jvwStepsCancelButtonClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.cmdCancelClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.cmdNextClick(Sender: TObject);
|
||||
var ePath: String;
|
||||
eRegistry: TRegistry;
|
||||
ChosenMod: TMod;
|
||||
eStr: TStringList;
|
||||
CurNode: TTreeNode;
|
||||
eOS: TOS;
|
||||
begin
|
||||
if jplWizard.ActivePage = jspFTP then begin
|
||||
{ FTP }
|
||||
eStr := TStringList.Create;
|
||||
ePath := '/';
|
||||
CurNode := trvDirectories.Selected;
|
||||
repeat
|
||||
ePath := '/' + CurNode.Text + ePath;
|
||||
CurNode := CurNode.Parent;
|
||||
until (not Assigned(CurNode));
|
||||
IdFTP.ChangeDir(ePath);
|
||||
IdFTP.List(eStr, '', False);
|
||||
if eStr.IndexOf('liblist.gam') = -1 then begin
|
||||
MessageBox(Handle, 'Invalid directory. Please select your mod directory and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
eStr.Free;
|
||||
exit;
|
||||
end
|
||||
else
|
||||
eStr.Free;
|
||||
|
||||
// design stuff
|
||||
trvDirectories.Enabled := False;
|
||||
cmdConnect.Enabled := False;
|
||||
optWindows.Enabled := False;
|
||||
optLinux32.Enabled := False;
|
||||
optLinux64.Enabled := False;
|
||||
cboGameAddon.Enabled := False;
|
||||
// preinstall...
|
||||
DelDir(ExtractFilePath(ParamStr(0)) + 'temp');
|
||||
MakeDir(ExtractFilePath(ParamStr(0)) + 'temp');
|
||||
DownloadFile('liblist.gam', ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
|
||||
Screen.Cursor := crHourGlass;
|
||||
ChosenMod := modNone;
|
||||
case cboGameAddon.ItemIndex of
|
||||
1: ChosenMod := modCS;
|
||||
2: ChosenMod := modDoD;
|
||||
3: ChosenMod := modNS;
|
||||
4: ChosenMod := modTFC;
|
||||
5: ChosenMod := modTS;
|
||||
6: ChosenMod := modCS;
|
||||
7: ChosenMod := modESF;
|
||||
end;
|
||||
|
||||
if optWindows.Checked then
|
||||
eOS := osWindows
|
||||
else if optLinux32.Checked then
|
||||
eOS := osLinux32
|
||||
else
|
||||
eOS := osLinux64;
|
||||
|
||||
jspInstallProgress.Show;
|
||||
rtfDetails.Lines.Text := 'Starting Pre-Installation, this may take a few minutes...';
|
||||
rtfDetails.Lines.Add('');
|
||||
Sleep(1500);
|
||||
ggeAll.Progress := 0;
|
||||
ggeItem.Progress := 0;
|
||||
InstallCustom(ExtractFilePath(ParamStr(0)) + 'temp\', ChosenMod, eOS);
|
||||
cmdNext.Hide;
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('- - - - -', clBlack, False);
|
||||
AddStatus('Uploading all files...', clBlack, False);
|
||||
AddStatus('', clBlack, False);
|
||||
Sleep(1500);
|
||||
// ... then upload ...
|
||||
ggeAll.Progress := 0;
|
||||
ggeItem.Progress := 0;
|
||||
Screen.Cursor := crAppStart;
|
||||
InstallFTP(ChosenMod, eOS);
|
||||
end
|
||||
else if jplWizard.ActivePage = jspInstallProgress then
|
||||
Close
|
||||
else if jplWizard.ActivePage = jspSelectMod then begin
|
||||
{ Dedicated Server }
|
||||
if (frbDedicatedServer.Checked) or (frbStandaloneServer.Checked) then begin
|
||||
jspInstallProgress.Show;
|
||||
ChosenMod := modNone;
|
||||
ePath := GetModPathName(lstMods.Items[lstMods.ItemIndex]);
|
||||
// ask for additional mods...
|
||||
if (ePath = 'cstrike') or (ePath = 'czero') then begin
|
||||
if MessageBox(Handle, 'Install Counter-Strike addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modCS;
|
||||
end;
|
||||
if ePath = 'dod' then begin
|
||||
if MessageBox(Handle, 'Install Day of Defeat addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modDoD;
|
||||
end;
|
||||
if ePath = 'ns' then begin
|
||||
if MessageBox(Handle, 'Install Natural Selection addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modNS;
|
||||
end;
|
||||
if ePath = 'tfc' then begin
|
||||
if MessageBox(Handle, 'Install Team Fortress Classic addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modTFC;
|
||||
end;
|
||||
if ePath = 'ts' then begin
|
||||
if MessageBox(Handle, 'Install The Specialists addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modTS;
|
||||
end;
|
||||
if ePath = 'esforce' then begin
|
||||
if MessageBox(Handle, 'Install Earth''s Special Forces addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modESF;
|
||||
end;
|
||||
// install it
|
||||
if frbDedicatedServer.Checked then begin
|
||||
if DirectoryExists(SteamPath + ePath) then
|
||||
InstallDedicated(SteamPath + ePath + '\', ChosenMod, True)
|
||||
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);
|
||||
Application.Terminate;
|
||||
exit;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
if DirectoryExists(StandaloneServer + ePath) then
|
||||
InstallDedicated(StandaloneServer + ePath + '\', ChosenMod, False)
|
||||
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);
|
||||
Application.Terminate;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{ Listen Server }
|
||||
if frbListenServer.Checked then begin
|
||||
ChosenMod := modNone;
|
||||
ePath := lstMods.Items[lstMods.ItemIndex];
|
||||
if DirectoryExists(SteamPath + ePath + '\' + GetModPathName(ePath)) then
|
||||
ePath := SteamPath + ePath + '\' + GetModPathName(ePath)
|
||||
else if DirectoryExists(SteamPath + 'half-life\' + ePath) then
|
||||
ePath := SteamPath + 'half-life\' + ePath
|
||||
else if DirectoryExists(SteamPath + 'half-life\' + GetModPathName(ePath)) then
|
||||
ePath := SteamPath + 'half-life\' + GetModPathName(ePath)
|
||||
else if DirectoryExists(SteamPath + GetModPathName(ePath)) then
|
||||
ePath := SteamPath + GetModPathName(ePath);
|
||||
|
||||
if Pos(SteamPath, ePath) = 0 then
|
||||
MessageBox(Handle, 'An error occured. Please report this bug to the AMX Mod X team and post a new thread on the forums of www.amxmodx.org.', PChar(Application.Title), MB_ICONSTOP)
|
||||
else begin
|
||||
if not FileExists(ePath + '\liblist.gam') then begin
|
||||
MessageBox(Handle, 'You have to play this game once before installing AMX Mod X. Do this and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
exit;
|
||||
end;
|
||||
|
||||
jspInstallProgress.Show;
|
||||
if (Pos('\cstrike', ePath) <> Pos('\counter-strike', ePath)) or (Pos('\condition zero', ePath) <> Pos('czero', ePath)) then begin // Counter-Strike & Condition Zero
|
||||
if MessageBox(Handle, 'Install Counter-Strike addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modCS;
|
||||
end
|
||||
else if Pos('\day of defeat', ePath) <> Pos('\dod', ePath) then begin // Day of Defeat
|
||||
if MessageBox(Handle, 'Install Day of Defeat addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modDoD;
|
||||
end
|
||||
else if Pos('\team fortress classic', ePath) <> Pos('\tfc', ePath) then begin // Team Fortress Classic
|
||||
if MessageBox(Handle, 'Install Team Fortress Classic addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modTFC;
|
||||
end
|
||||
else if Pos('half-life\ts', ePath) <> 0 then begin // The Specialists
|
||||
if MessageBox(Handle, 'Install The Specialists addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modTS;
|
||||
end
|
||||
else if Pos('half-life\ns', ePath) <> 0 then begin // Natural Selection
|
||||
if MessageBox(Handle, 'Install Natural Selection addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modNS;
|
||||
end
|
||||
else if Pos('half-life\ns', ePath) <> 0 then begin // Natural Selection
|
||||
if MessageBox(Handle, 'Install Earth''s Special Forces addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||
ChosenMod := modESF;
|
||||
end;
|
||||
ePath := ePath + '\';
|
||||
InstallListen(ePath, ChosenMod);
|
||||
end;
|
||||
end;
|
||||
{ Custom mod below }
|
||||
end
|
||||
else if jplWizard.ActivePage <> jspInstallMethod then
|
||||
jplWizard.NextPage
|
||||
else begin
|
||||
if frbDedicatedServer.Checked then begin // Dedicated Server
|
||||
eRegistry := TRegistry.Create(KEY_READ);
|
||||
try
|
||||
eRegistry.RootKey := HKEY_CURRENT_USER;
|
||||
if eRegistry.OpenKey('Software\Valve\Steam', False) then begin
|
||||
ePath := eRegistry.ReadString('ModInstallPath');
|
||||
ePath := Copy(ePath, 1, Length(ePath) -10) + '\dedicated server\';
|
||||
if DirectoryExists(ePath) then begin
|
||||
SteamPath := ePath;
|
||||
lstMods.Clear;
|
||||
// Check Mods
|
||||
lstMods.Items.Text := GetAllMods(ePath, False);
|
||||
// Misc
|
||||
jspSelectMod.Show;
|
||||
lstMods.ItemIndex := -1;
|
||||
cmdNext.Enabled := False;
|
||||
end
|
||||
else
|
||||
MessageBox(Handle, 'You have to run Dedicated Server once before installing AMX Mod X!', 'Error', MB_ICONWARNING);
|
||||
end
|
||||
else
|
||||
MessageBox(Handle, 'You haven''t installed Steam yet! Download it at www.steampowered.com, install Dedicated Server and try again.', 'Error', MB_ICONWARNING);
|
||||
finally
|
||||
eRegistry.Free;
|
||||
end;
|
||||
end
|
||||
else if frbListenServer.Checked then begin // Listen Server
|
||||
eRegistry := TRegistry.Create(KEY_READ);
|
||||
try
|
||||
eRegistry.RootKey := HKEY_CURRENT_USER;
|
||||
if eRegistry.OpenKey('Software\Valve\Steam', False) then begin
|
||||
ePath := eRegistry.ReadString('ModInstallPath') + '\';
|
||||
lstMods.Clear;
|
||||
ePath := Copy(ePath, 1, Length(ePath) -10);
|
||||
if DirectoryExists(ePath) then begin
|
||||
SteamPath := ePath;
|
||||
// Check Mods
|
||||
lstMods.Items.Text := GetAllMods(ePath, True);
|
||||
if DirectoryExists(ePath + 'half-life') then
|
||||
lstMods.Items.Text := lstMods.Items.Text + GetAllMods(ePath + 'half-life', False);
|
||||
// Misc
|
||||
jspSelectMod.Show;
|
||||
lstMods.ItemIndex := -1;
|
||||
cmdNext.Enabled := False;
|
||||
end
|
||||
else
|
||||
MessageBox(Handle, 'You haven''t installed Steam yet! Download it at www.steampowered.com, install Dedicated Server and try again.', 'Error', MB_ICONWARNING);
|
||||
end
|
||||
else
|
||||
MessageBox(Handle, 'You haven''t installed Steam yet! Download it at www.steampowered.com, install Dedicated Server and try again.', 'Error', MB_ICONWARNING);
|
||||
finally
|
||||
eRegistry.Free;
|
||||
end;
|
||||
end
|
||||
else if frbStandaloneServer.Checked then begin // Standalone Server
|
||||
eRegistry := TRegistry.Create;
|
||||
try
|
||||
eRegistry.RootKey := HKEY_CURRENT_USER;
|
||||
if eRegistry.OpenKey('Software\Valve\HLServer', False) then begin
|
||||
StandaloneServer := IncludeTrailingPathDelimiter(eRegistry.ReadString('InstallPath'));
|
||||
lstMods.Items.Text := GetAllMods(StandaloneServer, False);
|
||||
jspSelectMod.Show;
|
||||
end
|
||||
else
|
||||
MessageBox(Handle, 'You haven''t installed Half-Life Dedicated Server yet!', 'Error', MB_ICONWARNING);
|
||||
finally
|
||||
eRegistry.Free;
|
||||
end;
|
||||
end
|
||||
else if frbSelectMod.Checked then begin
|
||||
{ Custom mod }
|
||||
if frmSelectModPath.ShowModal = mrOk then begin
|
||||
jspInstallProgress.Show;
|
||||
ChosenMod := modNone;
|
||||
case frmSelectModPath.cboGameAddon.ItemIndex of
|
||||
1: ChosenMod := modCS;
|
||||
2: ChosenMod := modDoD;
|
||||
3: ChosenMod := modNS;
|
||||
4: ChosenMod := modTFC;
|
||||
5: ChosenMod := modTS;
|
||||
6: ChosenMod := modCS;
|
||||
7: ChosenMod := modESF;
|
||||
end;
|
||||
|
||||
InstallCustom(frmSelectModPath.trvDirectory.SelectedFolder.PathName + '\', ChosenMod, osWindows);
|
||||
end;
|
||||
end
|
||||
else if frbFTP.Checked then begin // FTP
|
||||
jspFTP.Show;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.CheckNext(Sender: TObject);
|
||||
begin
|
||||
cmdNext.Enabled := frbAgree.Checked;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.cmdBackClick(Sender: TObject);
|
||||
begin
|
||||
if jplWizard.ActivePage = jspFTP then
|
||||
jspInstallMethod.Show
|
||||
else begin
|
||||
jplWizard.PrevPage;
|
||||
cmdBack.Visible := jplWizard.ActivePageIndex <> 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.cmdConnectClick(Sender: TObject);
|
||||
var i: integer;
|
||||
eStr: TStringList;
|
||||
CurNode: TTreeNode;
|
||||
begin
|
||||
if (Trim(txtHost.Text) = '') or (Trim(txtUsername.Text) = '') or (Trim(txtPassword.Text) = '') then
|
||||
MessageBox(Handle, 'Please fill in each field!', PChar(Application.Title), MB_ICONWARNING)
|
||||
else if cmdConnect.Caption = 'Connect' then begin
|
||||
// ... design stuff ...
|
||||
Screen.Cursor := crHourGlass;
|
||||
cmdConnect.Enabled := False;
|
||||
cmdProxySettings.Enabled := False;
|
||||
txtHost.Enabled := False;
|
||||
txtPort.Enabled := False;
|
||||
txtUsername.Enabled := False;
|
||||
txtPassword.Enabled := False;
|
||||
chkPassive.Enabled := False;
|
||||
cmdConnect.Caption := 'Connecting...';
|
||||
// ... set values ...
|
||||
IdFTP.Host := txtHost.Text;
|
||||
IdFTP.Port := StrToInt(txtPort.Text);
|
||||
IdFTP.Username := txtUsername.Text;
|
||||
IdFTP.Passive := chkPassive.Checked;
|
||||
IdFTP.Password := txtPassword.Text;
|
||||
// ... connect and check values etc ...
|
||||
try
|
||||
IdFTP.Connect(True, 15000);
|
||||
except
|
||||
on E: Exception do begin
|
||||
// reset button properties
|
||||
cmdConnect.Enabled := True;
|
||||
txtHost.Enabled := True;
|
||||
txtPort.Enabled := True;
|
||||
txtUsername.Enabled := True;
|
||||
txtPassword.Enabled := True;
|
||||
chkPassive.Enabled := True;
|
||||
cmdProxySettings.Enabled := True;
|
||||
cmdNext.Enabled := False;
|
||||
cmdConnect.Caption := 'Connect';
|
||||
Screen.Cursor := crDefault;
|
||||
// analyze messages
|
||||
if Pos('Login incorrect.', E.Message) <> 0 then begin // login failed
|
||||
MessageBox(Handle, 'Login incorrect. Check your FTP settings and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
txtUsername.SetFocus;
|
||||
txtUsername.SelectAll;
|
||||
end
|
||||
else if Pos('Host not found.', E.Message) <> 0 then begin // host not found
|
||||
MessageBox(Handle, 'The entered host couldn''t be found. Check your settings and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
txtHost.SetFocus;
|
||||
txtHost.SelectAll;
|
||||
end
|
||||
else if Pos('Connection refused.', E.Message) <> 0 then begin // wrong port (?)
|
||||
MessageBox(Handle, 'The host refused the connection. Check your port and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
txtPort.SetFocus;
|
||||
txtPort.SelectAll;
|
||||
end
|
||||
else if E is EIdProtocolReplyError then begin // wrong port
|
||||
MessageBox(Handle, 'The port you entered is definitely wrong. Check it and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
txtPort.SetFocus;
|
||||
txtPort.SelectAll;
|
||||
end
|
||||
else
|
||||
MessageBox(Handle, PChar(E.Message), PChar(Application.Title), MB_ICONWARNING); // unknown error
|
||||
// ... connect failed, leave procedure ...
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
// ... connect successful, change captions ...
|
||||
trvDirectories.Enabled := True;
|
||||
cmdConnect.Enabled := True;
|
||||
cmdConnect.Caption := 'Disconnect';
|
||||
// ... scan for initial directory ...
|
||||
eStr := TStringList.Create;
|
||||
eStr.Text := StringReplace(IdFTP.RetrieveCurrentDir, '/', #13, [rfReplaceAll]);
|
||||
for i := eStr.Count -1 downto 0 do begin
|
||||
if eStr[i] = '' then
|
||||
eStr.Delete(i);
|
||||
end;
|
||||
|
||||
CurNode := nil;
|
||||
if eStr.Count <> 0 then begin
|
||||
for i := 0 to eStr.Count -1 do
|
||||
CurNode := trvDirectories.Items.AddChild(CurNode, eStr[i]);
|
||||
end;
|
||||
if trvDirectories.Items.Count <> 0 then
|
||||
trvDirectories.Items.Item[0].Expand(True);
|
||||
eStr.Free;
|
||||
|
||||
// ... scan for directories ...
|
||||
with GetAllDirs do begin
|
||||
for i := 0 to Count -1 do
|
||||
trvDirectories.Items.AddChild(trvDirectories.Items.AddChild(CurNode, Strings[i]), 'Scanning...');
|
||||
Free;
|
||||
end;
|
||||
|
||||
if Assigned(CurNode) then
|
||||
CurNode.Expand(False);
|
||||
Screen.Cursor := crDefault;
|
||||
end
|
||||
else begin
|
||||
Screen.Cursor := crHourGlass;
|
||||
IdFTP.Quit;
|
||||
trvDirectories.Items.Clear;
|
||||
trvDirectories.Enabled := False;
|
||||
cmdConnect.Enabled := True;
|
||||
cmdProxySettings.Enabled := True;
|
||||
txtHost.Enabled := True;
|
||||
txtPort.Enabled := True;
|
||||
txtUsername.Enabled := True;
|
||||
txtPassword.Enabled := True;
|
||||
chkPassive.Enabled := True;
|
||||
cmdConnect.Caption := 'Connect';
|
||||
cmdNext.Enabled := False;
|
||||
Screen.Cursor := crDefault;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.jplWizardChange(Sender: TObject);
|
||||
begin
|
||||
if (jplWizard.ActivePage = jspInstallProgress) then begin
|
||||
cmdNext.Caption := '&Finish';
|
||||
cmdNext.Enabled := False;
|
||||
cmdBack.Visible := False;
|
||||
end
|
||||
else begin
|
||||
cmdNext.Caption := '&Next >';
|
||||
cmdNext.Enabled := True;
|
||||
cmdBack.Visible := jplWizard.ActivePageIndex <> 0;
|
||||
end;
|
||||
|
||||
if (jplWizard.ActivePage = jspLicense) then
|
||||
cmdNext.Enabled := frbAgree.Checked;
|
||||
|
||||
if (jplWizard.ActivePage = jspFTP) then
|
||||
cmdNext.Enabled := False;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.FormCreate(Sender: TObject);
|
||||
begin
|
||||
if not DirectoryExists(ExtractFilePath(ParamStr(0)) + 'files') then begin
|
||||
MessageBox(Handle, 'The files-folder couldn''t be found. Run the Pre-Installer of AMX Mod X and try again.', 'Error', MB_ICONERROR);
|
||||
Application.Terminate;
|
||||
end
|
||||
else begin
|
||||
FileList := TStringList.Create;
|
||||
DirList := TStringList.Create;
|
||||
rtfDetails.Clear;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.lstModsClick(Sender: TObject);
|
||||
begin
|
||||
cmdNext.Enabled := lstMods.ItemIndex <> -1;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.cmdProxySettingsClick(Sender: TObject);
|
||||
begin
|
||||
frmProxy.ShowModal;
|
||||
// Apply Proxy Settings
|
||||
case frmProxy.cboProxy.ItemIndex of
|
||||
0: IdFTP.ProxySettings.ProxyType := fpcmNone; // none
|
||||
1: IdFTP.ProxySettings.ProxyType := fpcmHttpProxyWithFtp; // HTTP Proxy with FTP
|
||||
2: IdFTP.ProxySettings.ProxyType := fpcmOpen; // Open
|
||||
3: IdFTP.ProxySettings.ProxyType := fpcmSite; // Site
|
||||
4: IdFTP.ProxySettings.ProxyType := fpcmTransparent; // Transparent
|
||||
5: IdFTP.ProxySettings.ProxyType := fpcmUserPass; // User (Password)
|
||||
6: IdFTP.ProxySettings.ProxyType := fpcmUserSite; // User (Site)
|
||||
end;
|
||||
|
||||
IdFTP.ProxySettings.Host := frmProxy.txtHost.Text;
|
||||
IdFTP.ProxySettings.UserName := frmProxy.txtPort.Text;
|
||||
IdFTP.ProxySettings.Password := frmProxy.txtPassword.Text;
|
||||
IdFTP.ProxySettings.Port := StrToInt(frmProxy.txtPort.Text);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.txtPortChange(Sender: TObject);
|
||||
var i: integer;
|
||||
begin
|
||||
if txtPort.Text = '' then
|
||||
txtPort.Text := '21'
|
||||
else begin
|
||||
// check if value is numeric...
|
||||
for i := Length(txtPort.Text) downto 1 do begin
|
||||
if Pos(txtPort.Text[i], '0123456789') = 0 then begin
|
||||
txtPort.Text := '21';
|
||||
txtPort.SelStart := 4;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.trvDirectoriesExpanded(Sender: TObject;
|
||||
Node: TTreeNode);
|
||||
var ePath: String;
|
||||
CurNode: TTreeNode;
|
||||
i: integer;
|
||||
begin
|
||||
if Node.Item[0].Text = 'Scanning...' then begin // no directories added yet
|
||||
Screen.Cursor := crHourGlass;
|
||||
// get complete path
|
||||
ePath := '/';
|
||||
CurNode := Node;
|
||||
repeat
|
||||
ePath := '/' + CurNode.Text + ePath;
|
||||
CurNode := CurNode.Parent;
|
||||
until (not Assigned(CurNode));
|
||||
// change dir and add directories in it
|
||||
try
|
||||
Repaint;
|
||||
IdFTP.ChangeDir(ePath);
|
||||
with GetAllDirs do begin
|
||||
Node.Item[0].Free;
|
||||
for i := 0 to Count -1 do begin
|
||||
trvDirectories.Items.AddChild(trvDirectories.Items.AddChild(Node, Strings[i]), 'Scanning...');
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
Screen.Cursor := crDefault;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.trvDirectoriesChange(Sender: TObject; Node: TTreeNode);
|
||||
begin
|
||||
cmdNext.Enabled := Assigned(trvDirectories.Selected);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
FileList.Free;
|
||||
DirList.Free;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.IdFTPWork(Sender: TObject; AWorkMode: TWorkMode;
|
||||
const AWorkCount: Integer);
|
||||
begin
|
||||
if AWorkCount > 15 then begin
|
||||
ggeItem.Progress := AWorkCount;
|
||||
CurrProgress := AWorkCount;
|
||||
end;
|
||||
|
||||
if Cancel then
|
||||
IdFTP.Abort;
|
||||
|
||||
Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
if (jplWizard.ActivePage = jspFTP) and (IdFTP.Connected) then
|
||||
IdFTP.Quit;
|
||||
if (jplWizard.ActivePage = jspInstallProgress) and (ggeAll.Progress <> ggeAll.MaxValue) and (not Cancel) then begin
|
||||
if MessageBox(Handle, 'Do you really want to cancel the installation?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then begin
|
||||
Screen.Cursor := crDefault;
|
||||
Application.OnException := ExceptionHandler;
|
||||
Cancel := True;
|
||||
if IdFTP.Connected then
|
||||
IdFTP.Quit;
|
||||
end
|
||||
else
|
||||
Action := caNone;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ExceptionHandler(Sender: TObject; E: Exception);
|
||||
begin
|
||||
// we don't want any exceptions after close, so leave this empty
|
||||
end;
|
||||
|
||||
procedure TfrmMain.tmrSpeedTimer(Sender: TObject);
|
||||
begin
|
||||
Caption := CalcSpeed(OldProgress, CurrProgress);
|
||||
OldProgress := CurrProgress;
|
||||
end;
|
||||
|
||||
end.
|
BIN
installer/installer/UnitfrmProxy.dfm
Executable file
BIN
installer/installer/UnitfrmProxy.dfm
Executable file
Binary file not shown.
72
installer/installer/UnitfrmProxy.pas
Executable file
72
installer/installer/UnitfrmProxy.pas
Executable file
|
@ -0,0 +1,72 @@
|
|||
unit UnitfrmProxy;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
||||
StdCtrls, ExtCtrls, Forms, TFlatButtonUnit, TFlatComboBoxUnit,
|
||||
TFlatEditUnit;
|
||||
|
||||
type
|
||||
TfrmProxy = class(TForm)
|
||||
cmdCancel: TFlatButton;
|
||||
lblProxy: TLabel;
|
||||
txtHost: TFlatEdit;
|
||||
cboProxy: TFlatComboBox;
|
||||
lblHost: TLabel;
|
||||
txtPort: TFlatEdit;
|
||||
lblPort: TLabel;
|
||||
lblUsername: TLabel;
|
||||
txtUsername: TFlatEdit;
|
||||
txtPassword: TFlatEdit;
|
||||
lblPassword: TLabel;
|
||||
procedure cboProxyChange(Sender: TObject);
|
||||
procedure txtPortChange(Sender: TObject);
|
||||
public
|
||||
procedure EnableControls(Enable: Boolean);
|
||||
end;
|
||||
|
||||
var
|
||||
frmProxy: TfrmProxy;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
{ TfrmProxy }
|
||||
|
||||
procedure TfrmProxy.EnableControls(Enable: Boolean);
|
||||
begin
|
||||
lblHost.Enabled := Enable;
|
||||
lblPassword.Enabled := Enable;
|
||||
lblPort.Enabled := Enable;
|
||||
lblUsername.Enabled := Enable;
|
||||
txtHost.Enabled := Enable;
|
||||
txtPassword.Enabled := Enable;
|
||||
txtPort.Enabled := Enable;
|
||||
txtUsername.Enabled := Enable;
|
||||
end;
|
||||
|
||||
procedure TfrmProxy.cboProxyChange(Sender: TObject);
|
||||
begin
|
||||
EnableControls(cboProxy.ItemIndex <> 0); // 0 = None
|
||||
end;
|
||||
|
||||
procedure TfrmProxy.txtPortChange(Sender: TObject);
|
||||
var i: integer;
|
||||
begin
|
||||
if txtPort.Text = '' then
|
||||
txtPort.Text := '8080'
|
||||
else begin
|
||||
// check if value is numeric...
|
||||
for i := Length(txtPort.Text) downto 1 do begin
|
||||
if Pos(txtPort.Text[i], '0123456789') = 0 then begin
|
||||
txtPort.Text := '8080';
|
||||
txtPort.SelStart := 4;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
11
installer/installer/del.bat
Executable file
11
installer/installer/del.bat
Executable file
|
@ -0,0 +1,11 @@
|
|||
del .\*.~pas
|
||||
del .\*.dcu
|
||||
del .\*.~ddp
|
||||
del .\*.ddp
|
||||
del .\*.~dpr
|
||||
del .\*.~dfm
|
||||
del .\*.~dpr
|
||||
del .\*.map
|
||||
del .\*.drc
|
||||
del .\*.~xfm
|
||||
upx AMXInstaller.exe
|
281
installer/installer/gpl.txt
Executable file
281
installer/installer/gpl.txt
Executable file
|
@ -0,0 +1,281 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
NO WARRANTY
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Programs
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
BIN
installer/installer/install.bmp
Executable file
BIN
installer/installer/install.bmp
Executable file
Binary file not shown.
After Width: | Height: | Size: 151 KiB |
BIN
installer/installer/upx.exe
Executable file
BIN
installer/installer/upx.exe
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user