如何禁用 Inno SetupCreateUninstallRegKey http://www.jrsoftware.org/ishelp/index.php?topic=setup_createuninstallregkey通过代码?
My 安装程序在 Inno Setup 中创建的文件接受参数,例如:
setup.exe -a
or
setup.exe -b
If -a
提供参数,然后启用CreateUninstallRegKey
, or if -b
提供参数,然后禁用CreateUninstallRegKey
.
有没有办法设置CreateUninstallRegKey
通过代码还是我必须创建一个函数然后在脚本部分调用该函数?
This 帮助页面 http://jrsoftware.org/ishelp/topic_scriptconstants.htm解释了如何使用{code:...}
常量,但不幸的是我得到了这个错误:
Thanks
不要使用{code:}
用于将值传递给布尔类型指令的表达式。这样做:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
CreateUninstallRegKey=NeedsUninstallRegKey
[Code]
function CmdLineParamExists(const Value: string): Boolean;
var
I: Integer;
begin
Result := False;
for I := 1 to ParamCount do
if CompareText(ParamStr(I), Value) = 0 then
begin
Result := True;
Exit;
end;
end;
function NeedsUninstallRegKey: Boolean;
begin
Result := CmdLineParamExists('-a');
end;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)