When you use Features, you have the choice to perform some actions asking if you have checked or not checked every particular feature in a Managed UI.
For example, I implemented this ManagedProject, where I decided which files to include and which not according the selected feature. This is as an example, but I cannot include the whole code because copyright restrictions.
var project = new ManagedProject($"My Tool {productVersion}",
new InstallDir(@"c:\tool",
new Dir(winServiceFeature, "admin_service",
new Files(winServiceFeature, $"{adminOutputDir}\\*.*",
f => f.EndsWith(".exe") ||
f.EndsWith(".exe.config") ||
f.EndsWith(".dll"))),
new Dir(winServiceFeature, "graph_service",
new Files(winServiceFeature, $"{graphOutputDir}\\*.*",
f => !f.Contains(".dll.config") &&
(f.EndsWith(".exe") ||
f.EndsWith("ServiceW.exe.config") ||
f.EndsWith(".dll"))),
new Dir(winServiceFeature, "simulation_service",
new Files(winServiceFeature, $"{simulationOutputDir}\\*.*",
f => f.EndsWith(".exe") ||
f.EndsWith("WebServiceW.exe.config") ||
f.EndsWith(".dll"))),
new Dir(winServiceFeature, "my_frontend",
new Files(winServiceFeature, $"{frontendDir}\\app\\*.*"),
httpWebSite,
httpsWebSite),
new Dir(winServiceFeature, "templates",
new DirFiles(winServiceFeature, $"{templatesOutputDir}\\*.*",
f => f.EndsWith("common_functions.xml")),
new Dir(firstCustomerFeature, "customer1",
new Files(firstCustomerFeature, $"{templatesOutputDir}\\customer1\\*.*",
f => f.EndsWith(".xml"))),
new Dir(secondCustomerFeature, "customer2",
new Files(secondCustomerFeature, $"{templatesOutputDir}\\customer2\\*.*",
f => f.EndsWith(".xml"))),
new Dir(@"%ProgramMenu%\My Suite\My Tool",
new ExeFileShortcut("Uninstall My Tool", "[System64Folder]msiexec.exe", "/x [ProductCode]")),
launcherInstallServiceAction,
launcherUninstallServiceAction,
adminInstallServiceAction,
adminUninstallServiceAction,
graphInstallServiceAction,
graphUninstallServiceAction,
simulationInstallServiceAction,
simulationUninstallServiceAction,
installCertificatesAction,
uninstallCertificatesAction);
In this sample, I use f => f.EndsWith() filters to filter the files I want at the output. I also use new DirFiles() to get only files from an specific directory.
I think you should see the examples at this links:
WildCard sample from WixSharp
or
List directories issue at WixSharp