使用在[RUN]部分中的无功(use a var in [RUN] section)

2019-10-20 22:37发布

我想读在[Run]段一VAR值,凯茨说,这是我的代码 -

[Setup]

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion

[Run]
Filename: "{app}\MyProg.exe"; Description: ""; parameters:"/setid=SessionIDValue"

[code]
var

    SessionIDValue: String;

procedure InitializeWizard();

  begin

    SessionIDValue:= 'test';

    end;

是否有可能通过SessionIDValueparameters:"/setid=SessionIDValue"

10X的帮助

Answer 1:

您可以编写脚本{code:...}常量getter函数弥合[Code]使用脚本部分,例如部分:

[Run]
Filename: "{app}\MyProg.exe"; Parameters: "{code:GetSessionID}"

[Code]
var
  SessionID: string;

function GetSessionID(Param: string): string;
begin
  Result := SessionID;
end;


文章来源: use a var in [RUN] section
标签: inno-setup