# Actions: Update

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

## Contents

- [Check for update](#check-for-update) — `com.install4j.runtime.beans.actions.update.CheckForUpdateAction`
- [Schedule update installation](#schedule-update-installation) — `com.install4j.runtime.beans.actions.update.ScheduleUpdateAction`
- [Shut down calling launcher](#shut-down-calling-launcher) — `com.install4j.runtime.beans.actions.update.ShutdownCallingLauncherAction`

---

### Check for update
- **Class:** `com.install4j.runtime.beans.actions.update.CheckForUpdateAction`
- **Category:** Update
- **Multiple instances:** yes

Load the update descriptor from a URL and save it to a variable. If successful, the variable will contain an instance of com.install4j.api.UpdateDescriptor

| Property | Type | Category | Visible when | Description |
|---|---|---|---|---|
| `connectionFailureScript` — Network failure script | ScriptProperty → ErrorHandlingMode | Error Handling | — | A script that is executed if the HTTP connection fails in such a way, that the proxy dialog would have to be shown. If you return ErrorHandlingMode.IGNORE, the regular proxy or failure handling will proceed, if you return ErrorHandlingMode.CANCEL, the action will fail immediately. If you can take corrective action in the script, you can return ErrorHandlingMode.RETRY to make the same HTTP request again. However, you have to take special care not to enter an infinite loop. Typically, there should be user input before you retry and the user should be given the option to cancel.The script is only executed for actual network failures, and not if the server or the proxy connection requires authentication. |
| `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. |
| `connectTimeout` — Connect timeout in ms | int | Error Handling | — | The timeout for establishing the socket connection in milliseconds. A timeout of zero is interpreted as an infinite timeout. |
| `readTimeout` — Read timeout in ms | int | Error Handling | — | The timeout for reading data from the socket connection in milliseconds. A timeout of zero is interpreted as an infinite timeout. |
| `url` — Update descriptor URL | String | Configuration | — | The URL from which the update descriptor for this project can be downloaded. The update descriptor file is automatically created when compiling the project and can be found in the media output directory. The URL must start with http:// or https://. If you add a query string, it must already be URL encoded.For testing purposes, you can also use a file URL like file:/c:/test/updates.xml. |
| `requestHeaders` — Request headers | List [context=requestHeaders] | Configuration | — | A list of name-value pairs that should be set as additional headers for the request. Request headers that are installer variables with array or collection values (e.g. String[], Object[] or List<File>) are expanded as separate request headers, this allows you to build a variable length list of request headers at runtime. |
| `logRequestHeaders` — Log request headers | boolean | Configuration | — | If the request headers should be written into the log file or not. Disabled by default due to security reasons. |
| `showError` — Show error message | boolean | Error Handling | — | Show a default error message if the download fails. |
| `variable` — Variable | String [context=variableName] (variable→ UpdateDescriptor) | Configuration | — | The installer variable to which an instance of class com.install4j.api.UpdateDescriptor will be saved if the action is successful. |

### Schedule update installation
- **Class:** `com.install4j.runtime.beans.actions.update.ScheduleUpdateAction`
- **Category:** Update
- **Multiple instances:** yes

Schedule a downloaded media file to be started upon the next start of a launcher configured accordingly or by calling UpdateChecker.executeScheduledUpdate().

| Property | Type | Category | Visible when | Description |
|---|---|---|---|---|
| `installerFile` — Installer file | File | Configuration | — | The downloaded installer or macOS single bundle archive. |
| `version` — Version | String | Configuration | — | The version of the new installer. |
| `checkNewerVersion` — Check for newer installation | boolean | Configuration | — | Check directly before execution of the installation if a newer version has been installed in the meantime. |
| `arguments` — Installer arguments | String[] | Configuration | — | Optional additional arguments that should be passed to the installer. |
| `maxTries` — Maximum retries on error | int | Installation Error Handling | — | The maximum number of the times the installer will be executed if an error occurs during installation. |
| `maxCancelCount` — Maximum retries on cancel | int | Installation Error Handling | — | The maximum number of the times the installer will be executed if it was canceled by the user. |
| `retryInhibitionMinutes` — Retry inhibition in minutes | int | Installation Error Handling | — | The duration without retry after an error or cancel event. |

### Shut down calling launcher
- **Class:** `com.install4j.runtime.beans.actions.update.ShutdownCallingLauncherAction`
- **Category:** Update
- **Multiple instances:** yes

Shut down the launcher that called this application if it was started with the com.install4j.api.launcher.ApplicationLauncher API.

| Property | Type | Category | Visible when | Description |
|---|---|---|---|---|
| `wait` — Wait | boolean | Configuration | — | If selected the action will wait for the calling launcher to exit. |
| `timeout` — Timeout in s | int | Configuration | — | The timeout in seconds this action will wait if the 'Wait' property is true. If set to 0 there will be no timeout. |

