使用CreateInputFilePage
function创建自定义向导页面来提示用户输入许可证文件。
然后,使用scripted constant将所选路径用作[Files]
部分中的源路径。
[Files]
Source: "{code:GetLicensePath}"; DestDir: "{app}"; Flags: external
[Code]
var
LicenseFilePage: TInputFileWizardPage;
procedure InitializeWizard();
begin
LicenseFilePage :=
CreateInputFilePage(
wpSelectDir,
'Select License File Location',
'Where is your license file located?',
'Select where License file is located, then click Next.');
LicenseFilePage.Add(
'Location of license file:',
'License files|*.lic|All files|*.*',
'.lic');
end;
function GetLicensePath(Param: string): string;
begin
Result := LicenseFilePage.Values[0];
end;
TODO:你需要以某种方式处理的情况下,当用户不选择任何许可文件。请不要继续(使用NextButtonClick
)或跳过文件安装(使用Check
parameter)。