rmoc
Posts: 49
Joined: Tue Mar 14, 2017 8:27 pm

Multiple features use the same component with a synced folder

I have created a test project
TestProject.zip
(3.28 KiB) Downloaded 78 times
.

It contains two features. Both features use the same component, which is synchronised with a folder.
features.png
features.png (14.7 KiB) Viewed 1556 times
When I add a file called ‘file3.txt’ to the ‘files’ folder, the new file is recognised when I open it. However, it is now added as a new component in the root feature.

However, it is now added to the root feature as a new component.
addFileToRoot.png
addFileToRoot.png (15.89 KiB) Viewed 1556 times
I would have expected this file to be added to the ‘files’ component and therefore only installed when I install ‘Feature1’ or ‘Feature2’.
What am I doing wrong here, or do I just understand the basic behaviour of features, components and synchronised folders differently?
Catalin
Posts: 7504
Joined: Wed Jun 13, 2018 7:49 am

Re: Multiple features use the same component with a synced folder

Hello Rene,

What I think happened here, from what I observed in my testing, is that we reached quite a corner case. :D

Normally, since all files have the same extension, they will be added under the same component as per the "Best suited component" option.

However, in this specific scenario of yours, we have modified the tree quite a bit (e.g. we shared the component between multiple features, etc.).

A possible fix, although not sure how much that would help, is to remove the files and then refresh the sync. This will add all the files under the same component.

The downside of that is that the order you previously had will be lost (e.g. the component will no longer be shared between Feature1 and Feature2). We would have to share it again.

I will try to think of another way, perhaps some automation we can do to avoid this and will let you know if I will find anything.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 49
Joined: Tue Mar 14, 2017 8:27 pm

Re: Multiple features use the same component with a synced folder

Hello Catalin,

the only thing that helps is to activate the folder option ‘Do not save files in project’. Otherwise, the files will end up in features that are not intended for them.

Regards,
René
Catalin
Posts: 7504
Joined: Wed Jun 13, 2018 7:49 am

Re: Multiple features use the same component with a synced folder

Hello René,

Thank you for your followup on this and for sharing the solution with us.

The problem here, I think, stems from the fact that you have the synchronization done under "MainFeature".

We would need to have the synchronization done for each feature.

Here is my proposal:

Instead of 1 folder, have 2 folders that are both synched with the same folder from disk.
Screenshot_31.png
Screenshot_31.png (163.05 KiB) Viewed 1442 times
For each folder, we should have the "Use folder's component" option. And each folder should be tied to its feature (e.g. "files" folder to "Feature1" and "files2" folder to "Feature2").

Could you please try this and let me know if it helps?

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

Return to “Common Problems”