On this procedures, I want to select a file list from a x64 or x32 files lists and its working OK!
But I want:
1) Not to download the files already exists on the {app} directory, but I get an error because {app} is not defined. How to set the it?
2) How can I even improve the procedure to download an already existing file, but wich checksum is different? o Version?
THANKS in advance!
Nelson
____________
procedure InitializeWizard();
var
i: Integer;
subdir, subfile, OSlist: string;
begin
//Downloading file list
if Is64BitInstallMode then OSlist:='filelistx64.txt' else OSlist:='filelistx86.txt';
idpDownloadFile('{#webdir}'+OSlist, ExpandConstant('{tmp}\filelist.txt'));
FileList := TStringList.Create;
FileList.LoadFromFile(ExpandConstant('{tmp}\filelist.txt'));
for i := 0 to FileList.Count-1 do
begin
//Add each file to download queque
subdir:= ExtractDelimited(1,FileList[i]); //directory on Web
subfile:= ExtractDelimited(2,FileList[i]); //name of file
if not FileExists(ExpandConstant('{app}\') + subfile) then
idpAddFile('{#webdir}' + subdir + '/' + subfile, ExpandConstant('{tmp}\') + subfile);
end;
// idpDownloadAfter(wpReady);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
i: Integer;
subdir, subfile: string;
begin
if CurStep = ssPostInstall then
begin
// Copy downloaded files to application directory
for i := 0 to FileList.Count-1 do
begin
subdir:= ExtractDelimited(1,FileList[i]);
subfile:= ExtractDelimited(2,FileList[i]);
if not FileExists(ExpandConstant('{app}\') + subfile) then
FileCopy(ExpandConstant('{tmp}\') + subfile, ExpandConstant('{app}\') + subfile, false);
end;
end;
end;