# UninstallMode

Import: `import com.install4j.api.context.UninstallMode;`

```java
public final enum UninstallMode
```

Enumeration class that represents the different ways how install4j can handle the uninstallation of a file.


**See also:**

- [FileOptions](FileOptions.md)

## Constants

### IF_CREATED

Indicates that if the destination file was created by the installer, it will be deleted for uninstallation.
This is the default setting.

### NEVER

Indicates that the destination file won't be deleted for uninstallation.

### ALWAYS

Indicates that the uninstaller will always delete this file. Handle with care.

### IF_CREATED_BUT_NOT_FOR_UPDATE

Indicates that the destination file won't be deleted when the uninstaller runs as part of an update.
Otherwise it behaves like `IF_CREATED`.

### ALWAYS_BUT_NOT_FOR_UPDATE

Indicates that the destination file won't be deleted when the uninstaller runs as part of an update.
Otherwise it behaves like `ALWAYS`.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`values()`](#values) | `UninstallMode[]` |  |
| [`valueOf(String)`](#valueof-string) | `UninstallMode` |  |
| [`getFromIntValue(int)`](#getfromintvalue-int) | `UninstallMode` | Convert int value to constant. |
| [`getIntValue()`](#getintvalue) | `int` | Convert to an int value. |

### values()

```java
public static UninstallMode[] values()
```

### valueOf(String)

```java
public static UninstallMode valueOf(String name)
```

### getFromIntValue(int)

```java
public static UninstallMode getFromIntValue(int uninstall)
```

Convert int value to constant.


**Parameters:**

- `uninstall` — the int value

**Returns:** the constant or `null` if the int value does not correspond to a constant

### getIntValue()

```java
public int getIntValue()
```

Convert to an int value.


**Returns:** the int value

