Inno Setup: List all file names in an directory

user1752602

Am trying to list all files with names in an directory, but unable to do. Is there any way to list all files with names in an directory?

Thanks in advance.

TLama

The following script shows how to list all files of a specified directory into a TStrings collection (in this example listed in the list box on a custom page):

[Code]
procedure ListFiles(const Directory: string; Files: TStrings);
var
  FindRec: TFindRec;
begin
  Files.Clear;
  if FindFirst(ExpandConstant(Directory + '*'), FindRec) then
  try
    repeat
      if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
        Files.Add(FindRec.Name);
    until
      not FindNext(FindRec);
  finally
    FindClose(FindRec);
  end;
end;

procedure InitializeWizard;
var
  CustomPage: TWizardPage;
  FileListBox: TNewListBox;
begin
  CustomPage := CreateCustomPage(wpWelcome, 'Caption', 'Description');
  FileListBox := TNewListBox.Create(WizardForm);
  FileListBox.Parent := CustomPage.Surface;
  FileListBox.Align := alClient;

  ListFiles('C:\SomeDirectory\', FileListBox.Items);
end;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup - Preserve a single existing file, but install all other in a directory tree

From Dev

Read in all the files in a particular directory displays the file names in a html list

From Dev

Inno setup subfolders with additional installation in "All Programs" list?

From Dev

Check if all Strings in a String List are the Same in Inno Setup

From Dev

Inno Setup - How to increase the separation between all the components of the component list?

From Dev

Inno-setup pack all files in a folder exept for 1 file

From Dev

Inno-setup pack all files in a folder exept for 1 file

From Dev

inno-setup update file in all subdirectories where it exists

From Dev

Inno Setup second temporary directory

From Dev

What happens in Inno Setup when you list the same file twice?

From Java

bash: use list of file names to concatenate matching files across directories and save all files in new directory

From Dev

How to build a list of file names in a local directory?

From Dev

Replace a text in a file with Inno Setup

From Dev

Writing binary file in Inno Setup

From Dev

Writing binary file in Inno Setup

From Dev

List all file Name of a directory to Text File

From Dev

How to list all file names in terminal?

From Java

Require overwrite confirmation for one specific file in Inno Setup, install other files in directory unconditionally

From Dev

With Inno Setup how can I rename and copy a file a user chooses (an image) to the program files directory

From Dev

How to check for presence of a directory in Inno Setup preprocessor?

From Dev

Inno Setup: Color for modal and browse directory windows

From Dev

Inno Setup: Color for modal and browse directory windows

From Dev

Inno Setup get directory size including subdirectories

From Dev

List file names from a directory and place output in a text file

From Dev

How can I obtain all of the file names in a directory?

From Dev

Subtract 1 from all file names (rename them) in a directory.

From Dev

Rename all file names in a directory using datagridview column value

From Dev

How to remove `_` from all file-names in a directory

From Dev

Global alias for all files in a directory, by their file names (extensions, if available will be omitted)

Related Related

  1. 1

    Inno Setup - Preserve a single existing file, but install all other in a directory tree

  2. 2

    Read in all the files in a particular directory displays the file names in a html list

  3. 3

    Inno setup subfolders with additional installation in "All Programs" list?

  4. 4

    Check if all Strings in a String List are the Same in Inno Setup

  5. 5

    Inno Setup - How to increase the separation between all the components of the component list?

  6. 6

    Inno-setup pack all files in a folder exept for 1 file

  7. 7

    Inno-setup pack all files in a folder exept for 1 file

  8. 8

    inno-setup update file in all subdirectories where it exists

  9. 9

    Inno Setup second temporary directory

  10. 10

    What happens in Inno Setup when you list the same file twice?

  11. 11

    bash: use list of file names to concatenate matching files across directories and save all files in new directory

  12. 12

    How to build a list of file names in a local directory?

  13. 13

    Replace a text in a file with Inno Setup

  14. 14

    Writing binary file in Inno Setup

  15. 15

    Writing binary file in Inno Setup

  16. 16

    List all file Name of a directory to Text File

  17. 17

    How to list all file names in terminal?

  18. 18

    Require overwrite confirmation for one specific file in Inno Setup, install other files in directory unconditionally

  19. 19

    With Inno Setup how can I rename and copy a file a user chooses (an image) to the program files directory

  20. 20

    How to check for presence of a directory in Inno Setup preprocessor?

  21. 21

    Inno Setup: Color for modal and browse directory windows

  22. 22

    Inno Setup: Color for modal and browse directory windows

  23. 23

    Inno Setup get directory size including subdirectories

  24. 24

    List file names from a directory and place output in a text file

  25. 25

    How can I obtain all of the file names in a directory?

  26. 26

    Subtract 1 from all file names (rename them) in a directory.

  27. 27

    Rename all file names in a directory using datagridview column value

  28. 28

    How to remove `_` from all file-names in a directory

  29. 29

    Global alias for all files in a directory, by their file names (extensions, if available will be omitted)

HotTag

Archive