简体   繁体   中英

Hiding Inno Setup components

I'm trying build an installer w/ Inno Setup that runs other installers based on some configuration options. For simplicity, let's say I've got 20 installers that can be setup in 5 different configurations, where each configuration has some required and some optional installers. Configuration A might require installer 1, 2, 5, 6, and have options for 11, 13, and 14. Configuration B might require 1, 2, 3, 9, and have options for 12, 19, and 20. And so on.

I've got a Component for each installer. Ideally, I would have liked to use Types for the configurations, but I couldn't figure out how make some Components required while having others optional (if this is possible, please tell me). So, currently I have only a "custom" Type and use a custom wizard page that allows you to specify the configuration. Based on the selection, I'm using code to check and disable (so they can't be unselected) the required Components, while still allowing the optional Components to be selected.

In general it works pretty well, but I was hoping to only display the Components that are applicable for the selected configuration. So using the example above, for configuration A the Components page would show 1, 2, 5, 6 checked and disabled and 11, 13, and 14 unchecked and enabled. Is it possible to leave all of the components defined, but just hide the ones that aren't applicable? Or perhaps define multiple components pages, but only show the one for that configuration?

I found this solution online, but since the user could possibly hit the back button the notion that I could delete the components, but not re-add them doesn't seem like a good option.

No, the component list ( ComponentsList ) is populated only once, when the installer starts. It cannot be changed on run-time.

With such complex setup, you better give up on the built-in components functionality and build your own custom "components" page. Or you can keep the built-in "components" page, just hide the standard component list and build your own.

Create a similar layout, but re-create the "components" list, when an installation "type" changes.

You can bind the Files , Registry , etc sections entries to the custom components using theCheck parameter . Or you can update the real hidden component list based on the selection in the visible custom component list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM