Is it possible in Inno Setup to generate the file flags programmatically? My installer source contains a large number of files within a sizeable directory structure. Currently I've minimized the complexity of the script by adding entire folders at a time. This works fine, however, there are numerous files sprinkled throughout the hierarchy that aren't benefiting from compression (e.g. *.jpg) and are significantly increasing the installer build time. Ideally, I'd like to do something like:
Source: "{#MySrc}\*"; DestDir: "{#MyDst}"; Flags: {code:GetFlags};
Where GetFlags would check the extension of the current file and return "nocompression" for file types that I don't want to compress. Is that possible? I can't seem to find anything in the docs or online that would indicate that it is. If not, is there any other straight forward way to achieve this?
The only other way I can think of to do this is to create an additional file line for each type, like this
Source: "{#MySrc}\*"; DestDir: "{#MyDst}"; Excludes: "*.jpg,*.dds"; Flags: "ignoreversion recursesubdirs";
Source: "{#MySrc}\*.jpg"; DestDir: "{#MyDst}"; Flags: "ignoreversion recursesubdirs nocompression";
Source: "{#MySrc}\*.dds"; DestDir: "{#MyDst}"; Flags: "ignoreversion recursesubdirs nocompression";
While this is doable, I'd need to make this change in several places each time I came across a file type that I decided not to compress. So I'd rather keep the logic in a single place, if possible.