在[RUN]部分中使用var [英] use a var in [RUN] section
本文介绍了在[RUN]部分中使用var的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望在[RUN]部分中读取一个var值,kets说这是我的代码-
i wish to read a var value in [RUN] section, kets say this is my code -
[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;
是否可以将SessionIDValue
值传递给parameters:"/setid=SessionIDValue"
10倍的帮助
推荐答案
您可以编写脚本化的 [Code]
部分和脚本部分,例如:
You can write a scripted {code:...}
constant getter function to bridge the [Code]
section with scripting sections, e.g.:
[Run]
Filename: "{app}\MyProg.exe"; Parameters: "{code:GetSessionID}"
[Code]
var
SessionID: string;
function GetSessionID(Param: string): string;
begin
Result := SessionID;
end;
这篇关于在[RUN]部分中使用var的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文