Inno Setup:仅在不静音时安装 [英] Inno Setup: Install only if not VERYSILENT
问题描述
仅当安装程序不是以VERYSILENT运行时,我才想安装并重新注册某个文件.
I would like to install and regsiter a certain file only if the setup is not run as VERYSILENT.
我不知道该怎么实现.
我当前的行是
Source: "M:\sqlite36_engine.dll"; DestDir: {sys}; Flags: uninsneveruninstall ignoreversion
有人可以告诉我该怎么做吗?
Can somebody tell me how this can be done?
谢谢!
推荐答案
由于仍然没有运行时函数或变量来确定安装程序是否以非常安静的模式运行,因此您需要使自己的函数通过迭代来进行检查命令行参数.为了有条件地安装某些文件,我们使用 Check
参数,可以使用此类函数通过其返回值获取条件.下面的脚本应该执行您想要的操作:
Since there is still no runtime function or variable to determine if the setup is running in very silent mode, you need to make your own function to check this by iterating command line parameters. For conditional installing of a certain file we're using the Check
parameter, which can take such function for getting the condition by its returned value. The following script should do what you want:
[Files]
Source: "M:\sqlite36_engine.dll"; DestDir: {sys}; Flags: uninsneveruninstall ignoreversion; Check: not IsVerySilent
[Code]
function IsVerySilent: Boolean;
var
I: Integer;
begin
Result := False;
for I := 1 to ParamCount do
if CompareText(ParamStr(I), '/verysilent') = 0 then
begin
Result := True;
Exit;
end;
end;
这篇关于Inno Setup:仅在不静音时安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!