# Actions: Top level

install4j BeanInfo catalog. Each entry below documents a bean class that can appear inside a `<serializedBean>` element in an install4j project file.

## Contents

- [Download and install component](#download-and-install-component) — `com.install4j.runtime.beans.actions.DownloadAndInstallComponentAction`
- [Execute previous uninstaller](#execute-previous-uninstaller) — `com.install4j.runtime.beans.actions.UninstallPreviousAction`
- [Install files](#install-files) — `com.install4j.runtime.beans.actions.InstallFilesAction`
- [Uninstall files](#uninstall-files) — `com.install4j.runtime.beans.actions.UninstallFilesAction`

---

### Download and install component
- **Class:** `com.install4j.runtime.beans.actions.DownloadAndInstallComponentAction`
- **Multiple instances:** yes

Download a specified downloadable component and install it. This action only works for installation components that have been marked as "downloadable" on the "Options" tab of the installation component configuration.Note: The "Install Files" action already downloads and installs all selected downloadable installation components. This action is intended for scenarios where an installation component has to be downloaded after the "Install files" action has run. For example, you could use this in a custom installer application to install optional files.

| Property | Type | Category | Visible when | Description |
|---|---|---|---|---|
| `componentId` — Installation component | String [context=downloadableComponent] | Configuration | — | The installation component to be downloaded. Only downloadable installation components are displayed |
| `fileFilterScript` — File filter | ScriptProperty → boolean | Handlers | — | Expression or script that is invoked for each file to decide whether to install the file or not. |
| `directoryResolverScript` — Directory resolver | ScriptProperty → File | Handlers | — | Expression or script that resolves the actual installation directory separately for each installed file. Return null, if you would like to choose the standard installation directory for a file. |
| `showProgress` — Show progress | boolean | Configuration | — | If selected, and a progress bar is available on the current screen, the action will show its progress in the progress bar. |
| `showFileNames` — Show file names | boolean | Configuration | — | If selected, the names of the files that are installed will be shown during the installation. |
| `acceptAllCertificates` — Accept all SSL certificates | boolean | Error Handling | — | If the protocol of the URL starts with "https" and this property is selected, the SSL certificate will not be checked for validity. This is only recommended for testing purposes when working with self-signed certificates. |
| `delay` — Delay if necessary | boolean | Windows | — | If selected and a destination file cannot be replaced, the operation will be scheduled for the next reboot. The context method isRebootRequired() will return true in this case. |
| `triggerReboot` — Trigger reboot if required | boolean | Windows | — | If selected and an operation is delayed until reboot, the user will be asked for a reboot automatically at the end of installation. |
| `installInSingleBundle` — Install in single bundle | boolean | macOS | — | This option only applies to single bundle media types. If selected, files will be resolved inside the bundle. In this case, the behavior is equivalent to the "Install files" action. If not selected, files will be resolved as specified in the distribution tree. A "Directory resolver" script can be used to specify a useful installation location. |

### Execute previous uninstaller
- **Class:** `com.install4j.runtime.beans.actions.UninstallPreviousAction`
- **Multiple instances:** yes

Uninstalls the previous installation of this application in the selected installation directory by executing the previous uninstaller.

| Property | Type | Category | Visible when | Description |
|---|---|---|---|---|
| `installationDirectory` — Installation directory | File | Configuration | — | The installation directory for which the uninstaller should be run. Leave empty for the current installation directory. |
| `onlyIfSameApplicationId` — Only if the same application ID is found | boolean | Configuration | — | If selected, the action will only be performed if the application ID found in the installation directory is the same as that of the currently executed installer. |
| `uninstallServices` — Uninstall services | boolean | Configuration | — | If selected, the uninstaller will auto-uninstall services. Deselect this option if you want to retain previous service settings like the user account setting on Windows. Works only with uninstallers built with install4j 6.1+. |
| `installerVariables` — Installer variables | Map [context=installerVariables] | Configuration | — | Specify installer variables that should be passed to the uninstaller.Use the button on the right side to open a dialog for easy entry or enter a list of definitions separated by semicolons like var1=value1;var2=value2. Use installer variables from the installer with the usual syntax var1=${installer:otherVar}. |

### Install files
- **Class:** `com.install4j.runtime.beans.actions.InstallFilesAction`
- **Multiple instances:** yes

Install all files in the distribution tree that are contained in the selected installation components.

| Property | Type | Category | Visible when | Description |
|---|---|---|---|---|
| `fileFilterScript` — File filter | ScriptProperty → boolean | Handlers | — | Expression or script that is invoked for each file to decide whether to install the file or not. |
| `directoryResolverScript` — Directory resolver | ScriptProperty → File | Handlers | — | Expression or script that resolves the actual installation directory separately for each installed file. Return null, if you would like to choose the standard installation directory for a file. |
| `sizeCalculatorScript` — Installation size calculator | ScriptProperty → long | Handlers | — | Expression or script that calculates a custom installation size in bytes. The default size in bytes is passed as a parameter. |
| `validateApplicationId` — Validate application id | boolean | Configuration | — | Check if another application is installed in the selected directory or if the application is not the correct target for an add-on installer. If you have an "installation location" screen, you don't have to select this option. |
| `checkFreeSpace` — Insufficient disk space warning | boolean | Configuration | — | Show a warning message if there is no sufficient disk space for the installation on the selected target drive. |
| `installRuntime` — Install runtime | boolean | Configuration | — | Create the installation directory and install the install4j runtime. If your installer just modifies some folders and does not need launchers, an uninstaller or custom installer applications, you can deselect this option and use other installation roots in the distribution tree to install files. |
| `saveDownloadedFiles` — Save downloaded files | boolean | Configuration | — | If this property is set and the action downloads files it will try to place them next to the media file. In this case, the installer won't have to download the files again if it is invoked another time. |
| `showFileNames` — Show file names | boolean | Configuration | — | If selected, the names of the files that are installed will be shown during the installation. |
| `acceptAllCertificates` — Accept all SSL certificates | boolean | Error Handling | — | If the protocol of the URL starts with "https" and this property is selected, the SSL certificate will not be checked for validity. This is only recommended for testing purposes when working with self-signed certificates. |
| `delay` — Delay if necessary | boolean | Windows | — | If selected and a destination file cannot be replaced, the operation will be scheduled for the next reboot. The context method isRebootRequired() will return true in this case. |
| `triggerReboot` — Trigger reboot if required | boolean | Windows | — | If selected and an operation is delayed until reboot, the user will be asked for a reboot automatically at the end of installation. |

### Uninstall files
- **Class:** `com.install4j.runtime.beans.actions.UninstallFilesAction`
- **Multiple instances:** no

Uninstall all installed files.If a bundled JRE is present, that JRE will be removed after this action is run. This means that some operations, like launching a process, will not be possible anymore and result in an error. Such actions need to be moved before the "Uninstall files".

