如何将[Code]部分中的两个变量传递给Inno Setup中[Run]部分的参数?
基本上,我想做以下几点。
我真的没有找到如何将它放入inno脚本中:
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent; Parameters: "{code:GetBatchParams GetBatchParams2}"
[Code]
var
DirInputPage: TInputDirWizardPage;
DirInputPage2: TInputDirWizardPage;
function GetBatchParams(Value: string): string;
begin
Result := DirInputPage.Values[0];
end;
procedure InitializeWizard;
begin
DirInputPage := CreateInputDirPage(wpWelcome, 'Set Oracle kit path', '',
'', False, '');
DirInputPage.Add('Choose the location of Database folder as extracted from Oracle kit archives:');
DirInputPage.Values[0] := ExpandConstant('{src}');
end;
function GetBatchParams2(Value: string): string;
begin
Result := DirInputPage2.Values[0];
end;
procedure InitializeWizard2;
begin
DirInputPage := CreateInputDirPage(wpWelcome, 'Set qpay interface path', '',
'', False, '');
DirInputPage.Add('Choose the location of ear file:');
DirInputPage.Values[0] := ExpandConstant('{src}');
end;
感谢
编辑: 我做了一些修改以反映我的需求(一个文件夹,一个文件)。我不知道如何将它们作为可执行文件的参数传递(我不知道如何编写代码指令以使安装程序启动这些向导)
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent; Parameters: "{code:GetBatchParams GetBatchParams2}"
[Code]
var
DirInputPage: TInputDirWizardPage;
FileInputPage: TInputFileWizardPage;
function GetBatchParams(Value: string): string;
begin
Result := DirInputPage.Values[0];
end;
procedure InitializeWizard;
begin
DirInputPage := CreateInputDirPage(wpWelcome, 'Set Oracle kit path', '', '', False, '');
DirInputPage.Add('Choose the location of Database folder as extracted from Oracle kit archives:');
DirInputPage.Values[0] := ExpandConstant('{src}');
end;
function GetBatchParams2(Value: string): string;
begin
Result := FileInputPage.Values[0];
end;
procedure InitializeWizard;
begin
FileInputPage := CreateInputFilePage(wpWelcome, 'Set qpay interface path', 'where is war', '');
FileInputPage.Add('Location of ear file:', 'Executable files|*.ear|All files|*.*', '.ear');
end;