can you help me?

334 views
Skip to first unread message

Gianfire Cuccia

unread,
May 5, 2014, 9:29:00 AM5/5/14
to inno-downl...@googlegroups.com
Hi,
1) how can I get the detail section open by default?

2) how can I do the download of the file directly inside the {app} and not in the {temp} dir?

3)
How can I avoid downloading files if they already exist?

thank in advance

Mitrich K

unread,
May 5, 2014, 12:36:16 PM5/5/14
to inno-downl...@googlegroups.com
1) idpSetOption('DetailedMode', '1');

2) 
  1. When InitializeWizard executed, {app} constant is not valid, so you need to call idpAddFile after user selects directory.
  2. If you need to save files directly into {app} directory, files should be downloaded when {app} dir already created. This can be done by inserting download page after wpInstalling page.
3) You can use FileExists function.

Example:

[Code]
procedure InitializeWizard();
begin
    idpSetOption('DetailedMode', '1');
    idpDownloadAfter(wpInstalling);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
    if CurPageID = wpReady then 
    begin
        idpAddFile('http://www.xxx.yyy/test1.zip', ExpandConstant('{app}\test1.zip'));
        idpAddFile('http://www.xxx.yyy/test2.zip', ExpandConstant('{app}\test2.zip'));

        if not FileExists('C:\File.xyz') then
            idpAddFile('http://www.xxx.yyy/File.xyz', 'C:\File.xyz');
    end;
end;

Gianfire Cuccia

unread,
May 5, 2014, 2:11:15 PM5/5/14
to inno-downl...@googlegroups.com
thanks but this don't work because the downloads start after the [run] file
I need before download the file and then use it in [run] section.


Gianfire Cuccia

unread,
May 5, 2014, 2:16:02 PM5/5/14
to inno-downl...@googlegroups.com
next problem:
when I use Source:files , I can set the Permissions: options

If I use idpAddFile('http://www.xxx.yyy/test2.zip', ExpandConstant('{app}\test2.zip')); who can I set the Permissions: options?

Mitrich K

unread,
May 6, 2014, 5:06:12 AM5/6/14
to inno-downl...@googlegroups.com
Then you need to create {app} directory:
procedure CurPageChanged(CurPageID: Integer);
begin
    if CurPageID = wpReady then 
    begin
        CreateDir('{app}');
...

Mitrich K

unread,
May 6, 2014, 5:18:49 AM5/6/14
to inno-downl...@googlegroups.com
IDP has no functionality to set file permissions. Better way to do this is to download files in {tmp} dir, then install them in [Files] section, as shown in example2.iss:
[Files]
Source: "{tmp}\file.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576; Permissions: users-modify

[Code]
procedure InitializeWizard();
begin
    idpAddFile('http://www.abcd.com/file.xyz', ExpandConstant('{tmp}\file.xyz'));
    idpDownloadAfter(wpReady);
end;

Gianfire Cuccia

unread,
May 6, 2014, 5:33:31 AM5/6/14
to inno-downl...@googlegroups.com
yes tmp is better way.

But if I lunch the setup again it dowload the file again :(

is there a way to do the download again?

Gianfire Cuccia

unread,
May 9, 2014, 4:48:13 AM5/9/14
to inno-downl...@googlegroups.com
up

Nelson Belfort

unread,
Apr 5, 2017, 7:49:33 PM4/5/17
to Inno Download Plugin
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;
Reply all
Reply to author
Forward
Message has been deleted
0 new messages