如何检测设置是否在非常安静的模式下运行? [英] How to detect whether the setup runs in very silent mode?
问题描述
我知道有 WizardSilent
函数,用于检查安装程序是否以静默方式运行模式,但是我找不到等效于非常安静模式的功能(使用执行设置时/VERYSILENT
命令行参数).
I know there is the WizardSilent
function for checking whether the setup runs in silent mode, but I cannot find a function equivalent for very silent mode (when the setup is executed with /VERYSILENT
command line parameter).
有没有一种方法可以检测设置是否以非常安静的模式运行?
Is there a way to detect whether the setup runs in very silent mode?
推荐答案
WizardSilent
对于/Silent
和/VerySilent
安装均适用.这两个参数之间的区别是是否显示进度条(/Silent
)(/VerySilent
).
WizardSilent
will be true for both /Silent
and /VerySilent
installs. The difference between the two parameters is whether a progress bar is shown (/Silent
) or not (/VerySilent
).
根据您的评论,我最好的建议是检查命令行并查找/VerySilent
并设置一个全局变量.像这样:
Based on your comment, the best I can suggest would be to check the command line and look for /VerySilent
and set a global variable. Something like:
[Code]
var
isVerySilent: Boolean;
function InitializeSetup(): Boolean;
var
j: Integer;
begin
isVerySilent := False;
for j := 1 to ParamCount do
if CompareText(ParamStr(j), '/verysilent') = 0 then
begin
isVerySilent := True;
Break;
end;
if isVerySilent then
Log ('VerySilent')
else
Log ('not VerySilent');
end;
这篇关于如何检测设置是否在非常安静的模式下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!