两个或多个函数在检查参数中使用时不起作用
问题描述:
我一直在尝试使Check
中的两个函数工作。当我使用多个功能时,它们都不起作用。例如:两个或多个函数在检查参数中使用时不起作用
[Files]
Source: MyProg.exe; DestDir: "{app}"; Flags: ignoreversion; Check: portable and install;
Source: MyProg.dll; DestDir: "{app}"; Flags: ignoreversion; Check: portable and install;
Source: MyProg.ini; DestDir: "{app}"; Flags: ignoreversion; Check: portable and install;
当我只用一个检查便携式或安装,它的工作原理虽然我知道我可以重复的源代码目录,并把其他检查这样的:
[Files]
Source: MyProg.exe; DestDir: "{app}"; Flags: ignoreversion; Check: portable;
Source: MyProg.dll; DestDir: "{app}"; Flags: ignoreversion; Check: portable;
Source: MyProg.ini; DestDir: "{app}"; Flags: ignoreversion; Check: portable;
Source: MyProg.exe; DestDir: "{app}"; Flags: ignoreversion; Check: install;
Source: MyProg.dll; DestDir: "{app}"; Flags: ignoreversion; Check: install;
Source: MyProg.ini; DestDir: "{app}"; Flags: ignoreversion; Check: install;
但正如我有很多文件,我想在一个Check
中使用多个函数,因为它不会复制和粘贴[Files]
部分中的太多源代码行。
答
此:
[Files]
Source: MyProg.exe; DestDir: {app}; Check: portable and install
是不相同到:
[Files]
Source: MyProg.exe; DestDir: {app}; Check: install
Source: MyProg.exe; DestDir: {app}; Check: portable
第一说安装该文件,当两个portable
和install
为真/选择。可能永远不会发生。
而后者称安装该文件,当任portable
或install
为真/选择。
所以,你要使用or
操盘的and
:
[Files]
Source: MyProg.exe; DestDir: {app}; Check: portable or install
它是相同的,当我使用Check:IsWin64;或检查:“不是IsWin64”;我可以结合他们吗?例如:检查:IsWin64或安装; ? – Thebig1825
是的。虽然'IsWin64或Install'对我来说没有意义。你可能想要'IsWin64和Install'。 –
Ahh ok,所以我可以将它们合并为:检查:Iswin64并安装或可移植 – Thebig1825