Files - Defining Installation Components

## Files - Defining Installation Components |

| On this tab you can optionally define installation components. Installation components can be used to allow the user to customize the installation. GUI installers will present a step that lists all available installation components in a tree with check boxes and lets the user choose which components to install. Console installers will also present a list of installation components to the user for selection. If no installation components are defined, that step will be omitted and the entire distribution tree is installed.

| On the left side you configure a tree of installation components and component folders. To every component folder you can add installation components and component folders as child nodes. The component tree is drag-and drop enabled. In the component tree you can Move entries Components or component folders are moved by dragging them with the mouse to the desired location. To select a target folder inside a closed component folder while dragging, hover with the mouse over the closed component folder and it will open after a short delay. While dragging, the insertion bar shows you where the entry would be dropped. Add installation components With the [Add Installation Component] action, a new installation component is added to the currently selected component folder, or at the top-level if no component folder is selected. The name of the installation component can be edited in-place immediately. Add component folders With the [Add Component Folder] action, a new component folder is added to the currently selected component folder, or at the top-level if no component folder is selected. The name of the component folder can be edited in-place immediately. Delete entries With the [Delete] action or the `DEL` key, you can remove the currently selected installation component or component folder. All child nodes of component folders are removed as well. Rename entries With the [Rename] action, you can rename an installation component or a component folder. To internationalize the name of the component for different media files, please use custom localization keys.

| When using the install4j API, you reference installation components with IDs. You can show IDs in the component tree by activating the [Show IDs] button on the lower right side of the component tree. The automatically generated numerical IDs are then shown in brackets. The selection will be remembered across restarts of install4j. This ID can be used in expressions, scripts and custom code when you want to check if the installation component has been selected for installation. A typical condition expression for an action would be `context.getInstallationComponentById("123").isSelected()` if the ID of the component is "123". In this way you can conditionally execute actions depending on whether a component is selected or not.

| The right pane displays the properties of the selected element in the component tree. The options are organized into several tabs. There are different configuration options, depending on whether you've selected an installation component or a component folder: Installation component Installation components have the following specific tabs: Files To choose the contents of an installation component, you first have to decide whether the component contains all files or just a selection of files or directories. For a selection of files and directories, you then choose the desired contents in the tree. Installation components are not mutually exclusive and you can include the same files in multiple installation components. Options The available options are: Initially selected for installation Whether the check box for the currently selected installation component is selected or not. Mandatory component Whether the currently selected component must be installed or not. If the component is mandatory, the user cannot deselect it and the check box in the installer is grayed out. Downloadable component Whether the currently selected component should be externalized for installers whose data file type is set to "Downloadable". These components can then be placed on a web server and are downloaded on demand if the users selects them. Dependencies If the currently selected installation component only works if a number of other components are installed as well, you can select those components on the "Dependencies" tab. When this installation component is selected, the dependencies become automatically selected and mandatory. When this installation component is deselected again, the previous selection state of the dependencies is restored. The list of components in the "Dependencies" tab only shows components that will not lead to circular dependencies. Component folder Component folders have an "Options" tab where you can configure whether the component folder should be initially expanded or not. Both installation components and component folders also have a Description tab. You can optionally display a description below each component in the installer. Any component or component folder with a description will have a toggle button with help icon on the right side. This toggle button controls whether the description is displayed below the element. You can also use the `F1` key to toggle the visibility of the description. The Expand description automatically check box allows you to show descriptions by default.

| Note: The user can only select which installation components should be installed if the "Installation components" screen or the "Installation type" screen is part of the screen sequence. The "Installation type" screen offers a selection between sets of installation components, such as "Full", "Standard" and "Custom", while the "Installation components" screen shows the tree of components that you define on this tab with check boxes in front of each node. The "Installation components" screen has a number of properties that let you customize the appearance of the descriptions. If both are present, the "Installation components" screen will only be shown if the selected installation type was configured to be customizable.