* explicitly check if one of the files from the list of each package exists

This commit is contained in:
pierre 2002-04-10 21:18:42 +00:00
parent da73e3f995
commit f7ffc2e471

View File

@ -130,7 +130,7 @@ program install;
defcfgfile, defcfgfile,
setpathfile : string[12]; setpathfile : string[12];
include : boolean; include : boolean;
filechk : string[40]; { filechk : string[40]; Obsolete }
packages : longint; packages : longint;
package : array[1..maxpackages] of tpackage; package : array[1..maxpackages] of tpackage;
end; end;
@ -1492,8 +1492,8 @@ program install;
end; end;
cfg.pack[cfg.packs].binsub:=s; cfg.pack[cfg.packs].binsub:=s;
end end
else {else: Obsolete PM }
if item='FILECHECK' then { if item='FILECHECK' then
begin begin
if cfg.packs=0 then if cfg.packs=0 then
begin begin
@ -1501,7 +1501,7 @@ program install;
halt(1); halt(1);
end; end;
cfg.pack[cfg.packs].filechk:=s; cfg.pack[cfg.packs].filechk:=s;
end end }
else else
if item='TARGETNAME' then if item='TARGETNAME' then
begin begin
@ -1549,30 +1549,37 @@ program install;
procedure tapp.checkavailpack; procedure tapp.checkavailpack;
var var
j : longint; i, j : longint;
dir : searchrec; dir : searchrec;
one_found : boolean;
filename : string;
begin begin
{ check the packages } { check the packages }
j:=0; j:=0;
while (j<cfg.packs) do while (j<cfg.packs) do
begin begin
inc(j); inc(j);
if cfg.pack[j].filechk<>'' then one_found:=false;
begin {if cfg.pack[j].filechk<>'' then}
findfirst(cfg.pack[j].filechk,$20,dir); for i:=1 to cfg.pack[j].packages do
if doserror<>0 then begin
begin if file_exists(cfg.pack[j].package[i].zip,startpath) or
{ remove the package } file_exists(cfg.pack[j].package[i].zipshort,startpath) then
move(cfg.pack[j+1],cfg.pack[j],sizeof(tpack)*(cfg.packs-j)); begin
dec(cfg.packs); one_found:=true;
dec(j); break;
end; end;
{$IFNDEF TP} end;
findclose(dir);
{$ENDIF} if not one_found then
end; begin
end; { remove the package }
end; move(cfg.pack[j+1],cfg.pack[j],sizeof(tpack)*(cfg.packs-j));
dec(cfg.packs);
dec(j);
end;
end;
end;
procedure tapp.initmenubar; procedure tapp.initmenubar;
@ -1776,7 +1783,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.7 2002-04-03 12:46:02 pierre Revision 1.8 2002-04-10 21:18:42 pierre
* explicitly check if one of the files from the list of each package exists
Revision 1.7 2002/04/03 12:46:02 pierre
+ create setpath.bat file if Path is mixed + create setpath.bat file if Path is mixed
Revision 1.6 2002/03/19 09:14:56 pierre Revision 1.6 2002/03/19 09:14:56 pierre