this SHOULD fix the ftp bug

This commit is contained in:
Christian Hammacher 2006-09-13 21:11:53 +00:00
parent 61525e9638
commit 63ad5727ef
3 changed files with 35 additions and 25 deletions

Binary file not shown.

View File

@ -497,18 +497,18 @@ begin
UpdatePluginsIni := True; UpdatePluginsIni := True;
eStr := TStringList.Create; eStr := TStringList.Create;
// check if we need to modify mm's plugins.ini // check if we need to modify mm's plugins.ini
if (FileExists(ePath + '\addons\metamod\plugins.ini')) then begin if (FileExists(ePath + 'addons\metamod\plugins.ini')) then begin
eStr.LoadFromFile(ePath + '\addons\metamod\plugins.ini'); eStr.LoadFromFile(ePath + 'addons\metamod\plugins.ini');
if OS = osWindows then begin if OS = osWindows then begin
if (Pos(eStr.Text, 'addons\amxmodx\dlls\amxmodx_mm.dll') <> 0) then if (Pos(eStr.Text, 'addons\amxmodx\dlls\amxmodx_mm.dll') <> 0) then
UpdatePluginsIni := False; UpdatePluginsIni := False;
end end
else if OS = osLinux32 then begin else if OS = osLinux32 then begin
if (Pos(eStr.Text, 'addons\amxmodx\dlls\amxmodx_mm.dll') <> 0) then if (Pos(eStr.Text, 'addons/amxmodx/dlls/amxmodx_mm_i386.so') <> 0) then
UpdatePluginsIni := False; UpdatePluginsIni := False;
end end
else begin else begin
if (Pos(eStr.Text, 'addons\amxmodx\dlls\amxmodx_mm.dll') <> 0) then if (Pos(eStr.Text, 'addons/amxmodx/dlls/amxmodx_mm_amd64.so') <> 0) then
UpdatePluginsIni := False; UpdatePluginsIni := False;
end; end;
end end
@ -518,24 +518,27 @@ begin
eStr.Add('; AMX Mod X ' + VERSION); eStr.Add('; AMX Mod X ' + VERSION);
end; end;
// if there's no // if there's no
if (not UpdatePluginsIni) then begin if (UpdatePluginsIni) then begin
if OS = osWindows then begin if OS = osWindows then begin
eStr.Add('');
eStr.Add('win32 addons\amxmodx\dlls\amxmodx_mm.dll'); eStr.Add('win32 addons\amxmodx\dlls\amxmodx_mm.dll');
eStr.Add('; Enable this instead for binary logging'); eStr.Add('; Enable this instead for binary logging');
eStr.Add('; win32 addons\amxmodx\dlls\amxmodx_bl_mm.dll'); eStr.Add('; win32 addons\amxmodx\dlls\amxmodx_bl_mm.dll');
end end
else if OS = osLinux32 then begin else if OS = osLinux32 then begin
eStr.Add('');
eStr.Add('linux addons/amxmodx/dlls/amxmodx_mm_i386.so'); eStr.Add('linux addons/amxmodx/dlls/amxmodx_mm_i386.so');
eStr.Add('; Enable this instead for binary logging'); eStr.Add('; Enable this instead for binary logging');
eStr.Add('; linux addons/amxmodx/dlls/amxmodx_bl_mm_i386.so'); eStr.Add('; linux addons/amxmodx/dlls/amxmodx_bl_mm_i386.so');
end end
else begin else begin
eStr.Add('');
eStr.Add('linux addons/amxmodx/dlls/amxmodx_mm_amd64.so'); eStr.Add('linux addons/amxmodx/dlls/amxmodx_mm_amd64.so');
eStr.Add('; Enable this instead for binary logging'); eStr.Add('; Enable this instead for binary logging');
eStr.Add('; linux addons/amxmodx/dlls/amxmodx_bl_mm_amd64.so'); eStr.Add('; linux addons/amxmodx/dlls/amxmodx_bl_mm_amd64.so');
end; end;
eStr.SaveToFile(ePath + 'addons\metamod\plugins.ini');
end; end;
eStr.SaveToFile(ePath + 'addons\metamod\plugins.ini');
eStr.Free; eStr.Free;
end; end;
AddDone; AddDone;
@ -609,6 +612,13 @@ var eStr: TStringList;
begin begin
eGoBack := False; eGoBack := False;
ePath := '/';
CurNode := frmMain.trvDirectories.Selected;
repeat
ePath := '/' + CurNode.Text + ePath;
CurNode := CurNode.Parent;
until (not Assigned(CurNode));
Screen.Cursor := crAppStart; Screen.Cursor := crAppStart;
frmMain.cmdCancel.Show; frmMain.cmdCancel.Show;
frmMain.cmdCancel.Caption := '&Cancel'; frmMain.cmdCancel.Caption := '&Cancel';
@ -636,8 +646,22 @@ begin
for i := 0 to FileList.Count -1 do for i := 0 to FileList.Count -1 do
FileList[i] := Copy(FileList[i], Length(ExtractFilePath(ParamStr(0))) + 6, Length(FileList[i])); FileList[i] := Copy(FileList[i], Length(ExtractFilePath(ParamStr(0))) + 6, Length(FileList[i]));
// liblist.gam
CopyConfig := True; CopyConfig := True;
AddStatus('Checking for previous AMX Mod X installation...', clBlack);
// well, check it
try
frmMain.IdFTP.ChangeDir(ePath + 'addons/amxmodx/');
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 installation.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrNo: CopyConfig := False;
mrCancel: begin
Application.Terminate;
exit;
end;
end;
except
// nope, no installation found
end;
// liblist.gam
AddStatus('Editing liblist.gam...', clBlack); AddStatus('Editing liblist.gam...', clBlack);
eStr := TStringList.Create; eStr := TStringList.Create;
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam'); eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
@ -660,27 +684,10 @@ begin
eStr.Add('gamedll_linux "addons/metamod/dlls/metamod_amd64.so"'); eStr.Add('gamedll_linux "addons/metamod/dlls/metamod_amd64.so"');
FileSetAttr(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam', 0); FileSetAttr(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam', 0);
eStr.SaveToFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam'); eStr.SaveToFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
end
else 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 installation.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrNo: CopyConfig := False;
mrCancel: begin
Application.Terminate;
exit;
end;
end;
end; end;
eStr.Free; eStr.Free;
AddDone; AddDone;
ePath := '/';
CurNode := frmMain.trvDirectories.Selected;
repeat
ePath := '/' + CurNode.Text + ePath;
CurNode := CurNode.Parent;
until (not Assigned(CurNode));
{ create directories } { create directories }
AddStatus('Creating directories...', clBlack); AddStatus('Creating directories...', clBlack);
// rest... // rest...

View File

@ -9,7 +9,7 @@ uses
TFlatGaugeUnit, ImgList, FileCtrl, Registry, CheckLst, TFlatComboBoxUnit, TFlatGaugeUnit, ImgList, FileCtrl, Registry, CheckLst, TFlatComboBoxUnit,
TFlatCheckBoxUnit, IdBaseComponent, IdComponent, IdTCPConnection, TFlatCheckBoxUnit, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdFTP, IdException, IdAntiFreezeBase, IdAntiFreeze, IdTCPClient, IdFTP, IdException, IdAntiFreezeBase, IdAntiFreeze,
IdIntercept, IdLogBase, IdLogFile; IdIntercept, IdLogBase, IdLogFile, JclFileUtils;
type type
TfrmMain = class(TForm) TfrmMain = class(TForm)
@ -762,6 +762,9 @@ begin
DirList := TStringList.Create; DirList := TStringList.Create;
rtfDetails.Clear; rtfDetails.Clear;
end; end;
if (DirectoryExists(ExtractFilePath(ParamStr(0)) + 'temp')) then
DelTree(ExtractFilePath(ParamStr(0)) + 'temp');
end; end;
procedure TfrmMain.cmdProxySettingsClick(Sender: TObject); procedure TfrmMain.cmdProxySettingsClick(Sender: TObject);