Copy Hidden Files in Inno Setup

How to use hidden external copies of files in Inno Setup? Do not hide the file, but work with hidden files. Because for now: hidden files are ignored

Any help? Thanks)

[Files] Source: "{src}\folder\*"; DestDir: "{app}"; \ Flags: skipifsourcedoesntexist external ignoreversion recursesubdirs createallsubdirs; 
+1
source share
1 answer

When you select files in the [Files] section entry with a wildcard, the Inno Setup installer explicitly skips hidden files.

There is nothing you can do about it.

See RecurseExternalCopyFiles in Projects\Install.pas , especially in this part:

 if SourceIsWildcard then begin if FindData.dwFileAttributes and FILE_ATTRIBUTE_HIDDEN <> 0 then Continue; { <-- Skip hidden files, comment by @MartinPrikryl } FileName := FindData.cFileName; end else FileName := SearchWildcard; { use the case specified in the script } 

(This is for external files, just like what you use. But for compile-time files, this is the same. See BuildFileList in Compile.pas ).


All you can do is install in the [Code] script yourself, instead of using the [Files] section.

 procedure CurStepChanged(CurStep: TSetupStep); begin if CurStep = ssInstall then begin Log('Installing files'); DirectoryCopy(ExpandConstant('{src}\folder'), ExpandConstant('{app}')); end; end; 

To implement DirectoryCopy see my answer to the Inno Setup question : copy the folder, subfolders, and files recursively into the code section .


For compile-time files (without external ), you can generate a list of records [Files] using the FindFirst preprocessor function .

+2
source

Source: https://habr.com/ru/post/1234698/


All Articles