Inno Setup:还排除目录及其文件 [英] Inno Setup : Exclude a directory and its files also

查看:99
本文介绍了Inno Setup:还排除目录及其文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Inno Setup中使用"Exclude"标志,以便根据用户的体系结构从安装中排除子目录名称"Bin32"或"Bin64".

I use the "Exclude" flag in Inno Setup in order to exclude from installation a subdirectory name "Bin32" or "Bin64" depending on the user's architecture.

我只想不安装无用的文件夹及其所有文件和子目录.

All I want is to NOT install the useless folder and ALL its files and subdirectories as well.

这是我当前的规则:

[Files]
Source: "Z:\Work\temp\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

; Exclude
Source: "*"; Excludes: "\Bin64"; DestDir: "{app}"; Flags: recursesubdirs; Check: not Is64BitInstallMode
Source: "*"; Excludes: "\Bin32"; DestDir: "{app}"; Flags: recursesubdirs; Check: Is64BitInstallMode

首先,我不太了解排除规则开头的"*"代表什么?其次,它与Bin32/64文件夹中的所有子目录都可以正常工作,但文件仍已安装,我想不出一种方法来不安装它们...

First, I don't quite understand what the "*" stands for at the beginning of the excluded rules ? Second, it works fine with all subdirectories inside Bin32/64 folder but the files are still been installed and I can't figure out a way to not install them...

谢谢.

推荐答案

每个条目都是单个操作,不受任何其他条目的影响.考虑到这一点,将发生以下情况:

Each entry is a single operation and is not effected by any other entry. With that in mind, this is what happens:

  1. 第一行从 z:\ work \ temp 安装所有内容.
  2. 第二行(如果处于32位模式)将从 SourceDir 安装所有内容,除了 \ Bin64
  3. 如果在64位模式下,第三行将安装 SourceDir 中的所有内容,除了 \ Bin32
  1. The first line installs everying from z:\work\temp.
  2. The 2nd line, if in 32-bit mode, installs everything from SourceDir except \Bin64
  3. The 3rd line, if in 64-bit mode, installs everything from SourceDir except \Bin32

我希望您的 SourceDir (如果未指定脚本路径)与 Z:\ Work \ Temp 相同,因此,您基本上可以完成所有工作还是安装了.

I expect that your SourceDir (the script path if not specified) is the same as Z:\Work\Temp and as such, you essentially end up with everything installed anyway.

如果您复制第一个条目,并在其上移动 Excludes (不带\前缀)和 Check 参数,它将按您的要求工作:

If you duplicate the first entry, and move the Excludes (without the \ prefix) and Check parameters onto it, it should work as you require:

[Files]
Source: "Z:\Work\temp\*"; Excludes: "Bin64"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: not Is64BitInstallMode
Source: "Z:\Work\temp\*"; Excludes: "Bin32"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode

这篇关于Inno Setup:还排除目录及其文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆