inno-setup – Inno Setup:如何将变量从[代码]传递给[运行]
发布时间:2020-12-15 03:55:54 所属栏目:大数据 来源:网络整理
导读:如何将变量从[代码]部分传递给Inno Setup中[Run]部分中的参数? 基本上,我想做以下事情. 在过程InitializeWizard中获取并保存用户输入到变量. 在[运行]部分中将用户输入传递给可执行文件 这是我的代码 [Run]Filename: "someProgram.exe"; Parameters: ??user
如何将变量从[代码]部分传递给Inno Setup中[Run]部分中的参数?
基本上,我想做以下事情. >在过程InitializeWizard中获取并保存用户输入到变量. 这是我的代码 [Run] Filename: "someProgram.exe"; Parameters: ??userInput?? [Code] procedure InitializeWizard; var ConfigPage: TInputQueryWizardPage; UserInput: String; begin { Create the page } ConfigPage := CreateInputQueryPage( wpWelcome,'User input','Please specify the following information,then click Next.'); { Add items (False means it's not a password edit) } ConfigPage.Add('Input here:',False); { Set initial values (optional) } ConfigPage.Values[0] := ExpandConstant('hello'); { Read values into variables } UserInput := ConfigPage.Values[0]; end; 谢谢. 解决方法
您正在寻找
scripted constant.请参阅以下示例:
[Run] Filename: "SomeProgram.exe"; Parameters: {code:GetParams} [Code] var ConfigPage: TInputQueryWizardPage; function GetParams(Value: string): string; begin Result := ConfigPage.Values[0]; end; procedure InitializeWizard; begin { Create the page } ConfigPage := CreateInputQueryPage( wpWelcome,then click Next.'); { Add items (False means it's not a password edit) } ConfigPage.Add('Input here:',False); { Set initial values (optional) } ConfigPage.Values[0] := ExpandConstant('hello'); end; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |