installationinno-setuppascalscript

Install the same file to all subdirectories in Inno Setup


I am newbie with Inno Setup and I have been reading some threads but could not find how to do the following.

I simply would like to search for folders within a directory and in each folder detected install the same file with no selection of wizard page shown to the user. Not recursive, only files inside the detected folders and not subfolders.

I meant to install the same file in all folders detected while giving no option to the user to choose from. However, all other pages in the installer would be displayed as usual.

Thanks in advance


Solution

  • Thanks a lot Martin! I did it another way that may be of help to other users. I set a file for every potential folder I want to detect (it was only for four).

    [Files] Source: "C:\Users\XXXXX\dll\*"; DestDir: "{commonappdata}\XXXX\2023"; Check:CheckDir2023;
    

    Then I use the following to check if the folder exists:

    function CheckDir2023 : Boolean;
       begin
         if (DirExists(ExpandConstant('{commonappdata}\xxxxxx\2023\'))) then
           begin
             Result := True;
           end
         else
         begin
           Result := False;
         end;
       end;