Implemented update feature.

git-svn-id: trunk@53570 -
This commit is contained in:
balazs 2016-12-06 10:30:50 +00:00
parent 21d561cbd7
commit f49912d641
4 changed files with 13 additions and 11 deletions

View File

@ -387,14 +387,14 @@ begin
begin
if FNeedToBreak then
Break;
if (SerializablePackages.Items[I].Checked) and (Trim(SerializablePackages.Items[I].DownloadURL) <> '') then
if (SerializablePackages.Items[I].Checked) and (Trim(SerializablePackages.Items[I].DownloadZipURL) <> '') then
begin
Inc(FCnt);
FUpackageName := SerializablePackages.Items[I].Name;
FUPackageURL := SerializablePackages.Items[I].DownloadURL;
FUPackageURL := SerializablePackages.Items[I].DownloadZipURL;
FUTyp := 0;
Synchronize(@DoOnPackageUpdateProgress);
UpdateSize := GetUpdateSize(SerializablePackages.Items[I].DownloadURL, FUErrMsg);
UpdateSize := GetUpdateSize(SerializablePackages.Items[I].DownloadZipURL, FUErrMsg);
if UpdateSize > -1 then
begin
FUTyp := 1;
@ -431,11 +431,11 @@ begin
begin
if NeedToBreak then
Break;
if (SerializablePackages.Items[I].Checked) and (Trim(SerializablePackages.Items[I].DownloadURL) <> '') and
if (SerializablePackages.Items[I].Checked) and (Trim(SerializablePackages.Items[I].DownloadZipURL) <> '') and
(SerializablePackages.Items[I].UpdateSize > -1) and (not (psError in SerializablePackages.Items[I].PackageStates)) then
begin
Inc(FCnt);
FFrom := FixProtocol(SerializablePackages.Items[I].DownloadURL);
FFrom := FixProtocol(SerializablePackages.Items[I].DownloadZipURL);
FTo := FDownloadTo + SerializablePackages.Items[I].RepositoryFileName;
FCurSize := SerializablePackages.Items[I].UpdateSize;
DS := TDownloadStream.Create(TFileStream.Create(FTo, fmCreate));
@ -589,7 +589,7 @@ begin
FTotCnt := 0;
FTotSize := 0;
for I := 0 to SerializablePackages.Count - 1 do
if (SerializablePackages.Items[I].Checked) and (Trim(SerializablePackages.Items[I].DownloadURL) <> '') then
if (SerializablePackages.Items[I].Checked) and (Trim(SerializablePackages.Items[I].DownloadZipURL) <> '') then
Inc(FTotCnt);
FTimer := TThreadTimer.Create;
FTimer.OnTimer := @DoOnTimer;

View File

@ -165,7 +165,7 @@ begin
if (SerializablePackages.Items[I].Checked) then
begin
Inc(ChkCnt);
if (Trim(SerializablePackages.Items[I].DownloadURL) = '') then
if (Trim(SerializablePackages.Items[I].DownloadZipURL) = '') then
begin
Inc(InvCnt);
Node := FVST.AddChild(nil);

View File

@ -217,11 +217,11 @@ begin
begin
Package.ForceUpdate := FXML.GetValue('Items/' + Path + '/ForceUpdate', False);
Package.DownloadZipURL := FXML.GetValue('Items/' + Path + '/DownloadZipURL', '');
PackageFileName := FXML.GetValue('Items/' + Path + '/PackageFileName', '');
PackageFile := Package.FindPackageFile(PackageFileName);
if PackageFile <> nil then
PackageFile.UpdateVersion := FXML.GetValue('Items/' + Path + '/UpdateVersion', '');
end;
PackageFileName := FXML.GetValue('Items/' + Path + '/PackageFileName', '');
PackageFile := Package.FindPackageFile(PackageFileName);
if PackageFile <> nil then
PackageFile.UpdateVersion := FXML.GetValue('Items/' + Path + '/UpdateVersion', '');
end;
Synchronize(@DoOnUpdate);
end;

View File

@ -205,6 +205,7 @@ begin
begin
Position := 4;
Width := 280;
Options := Options - [coResizable];
Text := rsMainFrm_VSTHeaderColumn_Data;
end;
with Header.Columns.Add do
@ -408,6 +409,7 @@ begin
FVST.OnCollapsed := @VSTCollapsed;
FVST.OnExpanding := @VSTExpanding;
end;
HideButtons;
end;
function TVisualTree.IsAllChecked(const AChecking: PVirtualNode): Boolean;