sirosimous
Posts: 2
Joined: Mon Oct 30, 2023 6:07 pm

Dynamic Features based on folder/file discovery.

Hi,
I need some help creating a dynamic installer of potential available features.
My application contains a lot of optional features that are in 2x categories (CatA and CatB)
So far I created the Main Feature, Feature A and Feature B.
The available features under A and B will depend on the available sub-feature folders in the feature source folder ( _sourceFeatureA and _sourceFeatureB folder ).
Each sub-folder will contain the components (mostly DLLs) that will constitute a sub-feature under Feature A or B.
All features under A or B will be deployed towards a single folder ( destinationA or destination B)
The user should be able to choose which features to install.

For instance:
- _sourceFeatureA/FeatureA1/a1.dll will create the FeatureA1 subFeature, deploying a1.dll into destinationA folder
- _sourceFeatureB/FeatureB1/b1.dll & bRoot1.dll will create the FeatureB1 subFeature, deploying b1.dll & bRoot1.dll into destinationB folder

If it makes sense…. ;)
I have been able to create such architecture but it was all pointing at already known files. I’m not sure how to do it when I don’t have a definition of the sub-feature in advance.
I also read about Synchronized folders but I’m not sure how to automatically create feature out of the discovered folders/files and may be a template feature ??

Thank you for your help
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Dynamic Features based on folder/file discovery.

Hello and welcome to our forums,

If I understand what you need to achieve correctly, then indeed the Synchronization feature is what we can look at.

However, as you have mentioned, you would need to at least have the subfeature created in advance, so you can add the files under that specific feature when they will be generated on disk:
Screenshot_78.png
Screenshot_78.png (8.26 KiB) Viewed 8992 times
Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sirosimous
Posts: 2
Joined: Mon Oct 30, 2023 6:07 pm

Re: Dynamic Features based on folder/file discovery.

Thank you for the confirmation. Is there any way to create sub-features through scripting ?

Ultimately, the installer build will be realized in Azure Dev Ops through release pipeline, so another approach I thought about would be to use merge module instead. Each of my sub-Feature could create its own merge module, then each module would be transferred to the main installer project.
Is it possible to load Merge module in each FeatureA and FeatureB folder, synchronize the Feature folder so it dynamically add all the module ?
Is it possible to have the user picking what module have to be installed ?
Or does the selection, always linked to the Feature object ?

Thank you for your help
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Dynamic Features based on folder/file discovery.

Hello,

You are always welcome!
Is there any way to create sub-features through scripting ?
Yes, you could achieve that through the New Feature Command Option
Is it possible to load Merge module in each FeatureA and FeatureB folder, synchronize the Feature folder so it dynamically add all the module ?
Not quite sure I fully understand this. The merge module is indeed tied to a feature.
Is it possible to have the user picking what module have to be installed ?
This could be done by giving the user the possibility to choose which features to be installed and therefore which modules.

How to conditionally install a prerequisite based on the user selection?

(Ignore the prerequisite part, focus on the "feature" part)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”