procedure TFUMain.FormShow(Sender: TObject);
var A: Integer;
begin
JvXPProgressbar1.Position:= 0;
INIEinlesen;
UINIEinlesen;
for A := 1
to UFiles
do
begin
FileINI(IntToStr(A));
DateiDownload(USource,UZiel);
end;
VersionDatum:= UVersionDatum;
INISchreiben;
ShellExecute(Application.Handle,'
open',PChar('
eAV.exe'),
NIL,
NIL,SW_SHOWNORMAL);
Application.Terminate;
end;
procedure TFUMain.DateiDownload(Source, Ziel:
String);
var
fStream: TFileStream;
TempZiel:
String;
begin
JvXPProgressBar1.Position:= 0;
JvXpProgressBar1.Refresh;
if Copy(Ziel,1,2) ='
DB'
then
begin
if DBHost = '
'
then
begin
TempZiel:= DBOrdnerL + Copy(Ziel,3,Length(Ziel)-2);
end
else
begin
TempZiel:= DBOrdnerN + Copy(Ziel,3,Length(Ziel)-2);
end;
end
else
begin
TempZiel:= InstallPfad + '
\' + Ziel;
end;
Ziel:= TempZiel;
JvLabel1.Caption:= '
Download nach: ' + Ziel + '
...';
JvLabel1.Refresh;
try
fStream:= TFileStream.Create(Ziel,fmCreate
or fmShareDenyNone);
try
idHTTP1.Get(Source, fStream);
finally
fStream.Free;
end;
except
ShellExecute(Application.Handle,'
open',PChar('
eAV.exe'),
NIL,
NIL,SW_SHOWNORMAL);
Application.Terminate;
end;
end;
procedure TFUMain.IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode;
AWorkCount: Integer);
begin
JvXPProgressBar1.Position:= AWorkCount;
Application.ProcessMessages;
end;
procedure TFUMain.IdHTTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
AWorkCountMax: Integer);
begin
JvXPProgressBar1.Max:= AWorkCountMax;
end;