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を使用してください)。