So the question is this:
I asked a question back here: How to allow installation only to a specific folder?
How can I modify it a bit, so for example, I have 3 files to install, 2 of them are optional and should only be available to install, if a certain file/folder exists. I want to grey out the option to select them in the list, if the conditions are not met?
Thank you in advance.
Zsolt
I would try to do the following. It will access the component list items, disable and uncheck them by their index, what is the number starting from 0 taken from the order of the
[Components]section. The items withoutfixedflag (like in this case) are by default enabled, thus you need to check if the condition has not been met instead. You may check also thecommented versionof this post:The solution above has at least one weakness. The indexes might be shuffled from the original order from the
[Components]section when you set theComponentsList.Sortedto True. If you don’tuse it, it might be enough to use the above code, if yes, then it’s more complicated.
There is no simple way to get the component name (it is stored internally as
TSetupComponentEntryobject in theItemObjectof each item), only the description, so here is another way to do the same with the difference that the item indexes are being searched by their descriptions specified.