My Inno Setup script includes a directory:
[Files]
...
Source: C:\MyProg\Tools\*.*; Destdir: {app}\Tools
...
But sometimes this directory is empty and in that case Inno Setup stops with an error "No files matching ...".
My current workaround is adding an empty dummy file to that directory.
Can I make Inno Setup ignore this directory if it is empty?
Git doesn't ignore empty directories. It ignores all directories. In Git, directories exist only implicitly, through their contents. Empty directories have no contents, therefore they don't exist.
Simply include the recursesubdirs flag to your [Files] section entry. The help says about this flag the following: Instructs the compiler or Setup to also search for the Source filename/wildcard in subdirectories under the Source directory.
An empty file is a file of zero bytes size. An empty directory is a directory that doesn't contain any file or directory. It's fair to say that empty files don't consume space, but we should clean our file system from time to time as a best practice.
Did you try the skipifsourcedoesntexist
flag?
[Files]
...
Source: C:\MyProg\Tools\*.*; Destdir: {app}\Tools; Flags: skipifsourcedoesntexist
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With