Mike Dooley
Mike Dooley

Reputation: 966

File selection within InnoSetup

I want the user to select a license file during the installation, how can I create this kind of dialog? Can anyone show some sample code?

Upvotes: 4

Views: 1974

Answers (1)

Ken White
Ken White

Reputation: 125651

There is a code example in the Inno Setup documentation (see "Pascal Scripting", "Support Functions Reference", "Dialog functions" - you can start here):

var
  FileName: string;
begin
  // Set the initial filename
  FileName := '';
  if GetOpenFileName('', FileName, '', 
     'Text Documents (*.txt)|*.txt|All Files|*.*', 'txt') then
  begin
    // Successful; user clicked OK
    // Filename contains the selected filename
  end;
end;

Upvotes: 6

Related Questions