Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Inno Setup ignore empty directories?

Tags:

inno-setup

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?

like image 757
Daniel Rikowski Avatar asked Dec 02 '09 11:12

Daniel Rikowski


People also ask

Does git ignore empty directories?

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.

How do I add a folder to Inno?

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.

What are empty directories?

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.


1 Answers

Did you try the skipifsourcedoesntexist flag?

[Files]
...
Source: C:\MyProg\Tools\*.*; Destdir: {app}\Tools; Flags: skipifsourcedoesntexist 
...
like image 75
Timbo Avatar answered Oct 17 '22 02:10

Timbo