我有以下需要:
[Run]
;run robocopy.exe source dest/OLD/[source_contents] /options
其中:
用户必须在目标计算机上指定源(这可以根据物理平台进行更改)
目标与用户定义的源文件夹相同,而robocopy输入会自动创建子路径OLD/[source_contents]
。
我正在考虑使用"脚本常量",但问题是我需要以某种方式存储"源"提示参数在哪里(我不能要求两个提示相同的地方)。
感谢。
答案 0 :(得分:0)
scripted constant是一种方法。只需要确保只提示用户一次并重复使用源和目标路径的结果。
例如,您可以使用CreateInputDirPage
并实现脚本常量来引用用户在页面上指定的路径:
[Run]
Filename: "robocopy.exe"; Parameters: "{code:CopyDir} {code:CopyDir}\OLD"
[Code]
var
CopyDirPage: TInputDirWizardPage;
procedure InitializeWizard();
begin
CopyDirPage :=
CreateInputDirPage(wpSelectDir, 'Select source directory', '', '', False, '');
CopyDirPage.Add('Source directory:');
end;
function CopyDir(Params: string): string;
begin
Result := CopyDirPage.Values[0];
end;