简体   繁体   English

Inno Setup:如何将文件动态添加到安装中?

[英]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?有没有办法动态填充 Inno Setup 脚本的[Dirs][Files]部分?

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)在安装过程中,用户将选择foofoo匹配从我们的 SCM 获取的存储库)

  2. Setup will run a batch to checkout foo from our SCM安装程序将运行批处理以从我们的 SCM 中检出foo

  3. then the content of foo must be added to the [Dirs] and [Files] sections of the script然后必须将foo的内容添加到脚本的[Dirs][Files]部分

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.我觉得我的脚本应该嵌入我们 SCM 的所有存储库,然后才能仅将选定的存储库复制到目标目录。

Thanks for your help!谢谢你的帮助!

Regards,问候,

See Inno Setup Prompt for external file location .有关外部文件位置,请参阅Inno Setup Prompt

And add the recursesubdirs flag .并添加recursesubdirs标志

You may also need the createallsubdirs flag (assuming from your reference to the [Dirs] section).您可能还需要createallsubdirs标志(假设您参考了[Dirs]部分)。

[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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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