spacer
spacer

Reputation: 1507

InnoSetup: Trying to exclude all except one subfolder

I have an InnoSetup script that is supposed to exclude a subfolder full of other subfolders (>40) except one of them.
In the Compiler Output I do see files in this subfolder being compressed but the installation does not create that folder nor copies the files from it anywhere else.

The script looks like this:
(The Release\extra\more\subs is the folder full of other folders - I'd like to include only the Release\extra\more\subs\need_this_one.)

[Files]  
; Use all files and folders except some special ones
Source: "Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Excludes: "more\subs"
; Do use some specific folders
Source: "Release\extra\more\subs\need_this_one\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs

The first line should copy all files and folders in Release except any subfolders with path matching "more\subs" - and it does that.

I was under impression that the second line will then copy the Release\extra\more\subs\need_this_one subfolder and files in it - but it does not.

Does anyone have any idea why is that so?

Upvotes: 1

Views: 1866

Answers (1)

spacer
spacer

Reputation: 1507

Well, it seems I'm having a habit of answering my own questions. ;)

The catch was that DestDir needs the path on top of {app} to know where to put the files.

So, the script that works would be:

[Files]  
; Use all files and folders except some special ones
Source: "Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Excludes: "more\subs"
; Do use some specific folders
Source: "Release\extra\more\subs\need_this_one\*"; DestDir: "{app}\extra\more\subs\need_this_one"; Flags: ignoreversion recursesubdirs

It does makes sense, although it is not clear why, without the path, it did not simply copy files from need_this_one into {app} ...

Upvotes: 2

Related Questions