mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-07 18:38:30 +00:00
fixed bug where directories in the root directory were not detected (unless the start directory was the root directory)
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40335
This commit is contained in:
parent
ed2ba5b8b0
commit
b2e2e058e4
Binary file not shown.
@ -31,8 +31,8 @@
|
|||||||
-M
|
-M
|
||||||
-$M16384,1048576
|
-$M16384,1048576
|
||||||
-K$00400000
|
-K$00400000
|
||||||
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
-w-UNSAFE_TYPE
|
-w-UNSAFE_TYPE
|
||||||
-w-UNSAFE_CODE
|
-w-UNSAFE_CODE
|
||||||
-w-UNSAFE_CAST
|
-w-UNSAFE_CAST
|
||||||
|
|||||||
@ -1,6 +1,35 @@
|
|||||||
program MMS_Installer;
|
program MMS_Installer;
|
||||||
|
|
||||||
{ Metamod:Source installer is a port of the AMX Mod X installer
|
{
|
||||||
|
|
||||||
|
Metamod:Source installer is published under the zlib/libpng license, as well
|
||||||
|
as Metamod:Source itself. You can find a copy of it below.
|
||||||
|
|
||||||
|
---------
|
||||||
|
|
||||||
|
zLib/libpng License
|
||||||
|
|
||||||
|
Copyright (c) 2007, Metamod:Source Development Team
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
In no event will the authors be held liable for any damages arising from the
|
||||||
|
use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it freely,
|
||||||
|
subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software in a
|
||||||
|
product, an acknowledgment in the product documentation would be appreciated
|
||||||
|
but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
---------
|
||||||
|
|
||||||
Used components:
|
Used components:
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -402,6 +402,7 @@ procedure TfrmMain.cmdConnectClick(Sender: TObject);
|
|||||||
var i: integer;
|
var i: integer;
|
||||||
eStr: TStringList;
|
eStr: TStringList;
|
||||||
CurNode: TTreeNode;
|
CurNode: TTreeNode;
|
||||||
|
Path: String;
|
||||||
begin
|
begin
|
||||||
if (Trim(txtHost.Text) = '') or (Trim(txtUsername.Text) = '') then
|
if (Trim(txtHost.Text) = '') or (Trim(txtUsername.Text) = '') then
|
||||||
MessageBox(Handle, 'Please fill in each field!', PChar(Application.Title), MB_ICONWARNING)
|
MessageBox(Handle, 'Please fill in each field!', PChar(Application.Title), MB_ICONWARNING)
|
||||||
@ -425,27 +426,56 @@ begin
|
|||||||
// ... connect and check values etc ...
|
// ... connect and check values etc ...
|
||||||
try
|
try
|
||||||
IdFTP.Connect(True, 15000);
|
IdFTP.Connect(True, 15000);
|
||||||
// ... scan for initial directory ...
|
// ... get initial directory ...
|
||||||
|
Path := IdFTP.RetrieveCurrentDir;
|
||||||
|
// ... "fix" path ...
|
||||||
eStr := TStringList.Create;
|
eStr := TStringList.Create;
|
||||||
eStr.Text := StringReplace(IdFTP.RetrieveCurrentDir, '/', #13, [rfReplaceAll]);
|
eStr.Text := StringReplace(Path, '/', #13, [rfReplaceAll]);
|
||||||
for i := eStr.Count -1 downto 0 do begin
|
for i := eStr.Count -1 downto 0 do begin
|
||||||
if eStr[i] = '' then
|
if eStr[i] = '' then
|
||||||
eStr.Delete(i);
|
eStr.Delete(i);
|
||||||
end;
|
end;
|
||||||
|
if (Copy(Path, Length(Path) -1, 1) <> '/') then
|
||||||
|
Path := Path + '/';
|
||||||
// ... connect successful, change captions ...
|
// ... connect successful, change captions ...
|
||||||
trvDirectories.Enabled := True;
|
trvDirectories.Enabled := True;
|
||||||
cmdConnect.Enabled := True;
|
cmdConnect.Enabled := True;
|
||||||
cmdConnect.Caption := 'Disconnect';
|
cmdConnect.Caption := 'Disconnect';
|
||||||
|
// ... change to / and create all the directories ...
|
||||||
CurNode := nil;
|
CurNode := nil;
|
||||||
if eStr.Count <> 0 then begin
|
if (Path <> '/') then begin
|
||||||
for i := 0 to eStr.Count -1 do
|
try
|
||||||
CurNode := trvDirectories.Items.AddChild(CurNode, eStr[i]);
|
IdFTP.ChangeDir('/');
|
||||||
|
with GetAllDirs do begin
|
||||||
|
for i := 0 to Count -1 do begin
|
||||||
|
if (Assigned(CurNode)) then
|
||||||
|
trvDirectories.Items.AddChild(trvDirectories.Items.Add(nil, Strings[i]), 'Scanning...')
|
||||||
|
else begin
|
||||||
|
CurNode := trvDirectories.Items.Add(nil, Strings[i]);
|
||||||
|
trvDirectories.Items.AddChild(CurNode, 'Scanning...');
|
||||||
|
if (Pos('/' + CurNode.Text + '/', Path) = 0) then
|
||||||
|
CurNode := nil;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
IdFTP.ChangeDir(Path);
|
||||||
|
except
|
||||||
|
if (IdFTP.Connected) then
|
||||||
|
IdFTP.ChangeDir(Path)
|
||||||
|
else
|
||||||
|
IdFTP.Connect;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
if trvDirectories.Items.Count <> 0 then
|
// ... find directories in start path ...
|
||||||
trvDirectories.Items.Item[0].Expand(True);
|
if eStr.Count <> 0 then begin
|
||||||
|
for i := 0 to eStr.Count -1 do begin
|
||||||
|
if (not ((i = 0) and (Assigned(CurNode)))) then
|
||||||
|
CurNode := trvDirectories.Items.AddChild(CurNode, eStr[i]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
trvDirectories.Selected := CurNode;
|
||||||
eStr.Free;
|
eStr.Free;
|
||||||
|
|
||||||
// ... scan for directories ...
|
// ... scan for directories ...
|
||||||
with GetAllDirs do begin
|
with GetAllDirs do begin
|
||||||
for i := 0 to Count -1 do
|
for i := 0 to Count -1 do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user