是否可以从变量构建Inno Setup脚本行

时间:2013-05-28 00:32:48

标签: inno-setup

是否可以使用变量和某些条件构建脚本行(具有可执行文件,根据自定义页面上检查的内容,需要不同的开关。可能是这样的:

var
linecommand : string;
function FileParams();
  begin
    if check1 then linecommand := linecommand+' conditionone' end;
    if check2 then linecommand := linecommand+' conditiontwo' end;
    if check3 then linecommand := linecommand+' conditiontwo' end;
  end;
function check123()
  begin
    if check1 or check2 or check3 then
      begin
        linecommand='Executable file name.exe '+linecommand;
        Shellexec(linecommand);
      end;
   end;

1 个答案:

答案 0 :(得分:2)

您可以使用{code:...} constant[Code]函数中计算的值插入到接受字符串和常量(例如Parameters值的标准条目中的特定值中[Run]条目。

或者您可以编写多个条目并使用Check function来确定它们中的哪些(如果有)实际执行。