简体   繁体   中英

Inno Setup: How to dynamically add files to the installation?

Is there a way to dynamically fill the [Dirs] and [Files] sections of an Inno Setup script?

Here is what I am trying to do:

  1. during the install process, the user will select foo ( foo matches a repository to get from our SCM)

  2. Setup will run a batch to checkout foo from our SCM

  3. then the content of foo must be added to the [Dirs] and [Files] sections of the script

Everything works fine except for the last step. I searched around and couldn't find explanations on how to do this. I have the feeling that my script should embed all the repositories of our SCM to then be able to copy only the selected ones to the destination directory.

Thanks for your help!

Regards,

See Inno Setup Prompt for external file location .

And add the recursesubdirs flag .

You may also need the createallsubdirs flag (assuming from your reference to the [Dirs] section).

[Files]
Source: "{code:GetScmPath}"; DestDir: "{app}"; \
    Flags: external recursesubdirs createallsubdirs
[Code]

function GetScmPath(Param: string): string;
begin
  Result := { make it return path to the checked out files }
end;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM