now returns error message instead of bug report when trying to install 0 files

This commit is contained in:
Christian Hammacher 2007-08-12 20:28:21 +00:00
parent 84b146d74a
commit f0ee52f892
2 changed files with 13 additions and 1 deletions

Binary file not shown.

View File

@ -38,7 +38,7 @@ uses UnitfrmMain, UnitfrmProxy, UnitFunctions, UnitScanMods;
function InstallTime: String; function InstallTime: String;
begin begin
Result := FormatDateTime('HH:MM:SS', Now - StartTime); Result := Copy(FormatDateTime('HH:MM:SS', Now - StartTime), 4, 5);
end; end;
procedure AddStatus(Text: String; Color: TColor; ShowTime: Boolean = True); procedure AddStatus(Text: String; Color: TColor; ShowTime: Boolean = True);
@ -309,6 +309,18 @@ begin
AddDone('found ' + IntToStr(FileList.Count) + ' files..'); AddDone('found ' + IntToStr(FileList.Count) + ' files..');
AddStatus('', clBlack, False); AddStatus('', clBlack, False);
if (DirList.Count = 0) or (FileList.Count = 0) then begin
MessageBox(frmMain.Handle, 'Sorry, you do not seem to have any files in your files-directory. Please verify that you have properly installed the full AMX Mod X package and try again.', 'Error', MB_ICONERROR);
Screen.Cursor := crDefault;
Application.OnException := frmMain.ExceptionHandler;
Cancel := True;
if frmMain.IdFTP.Connected then
frmMain.IdFTP.Quit;
frmMain.cmdCancel.Caption := 'Close';
exit;
end;
frmMain.ggeAll.MaxValue := DirList.Count + FileList.Count; frmMain.ggeAll.MaxValue := DirList.Count + FileList.Count;
frmMain.ggeItem.MaxValue := DirList.Count; frmMain.ggeItem.MaxValue := DirList.Count;