> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installer skin

> Build a branded installer for your game with the DirectGVR installer skin template.

The installer skin template builds an installer that installs, uninstalls and repairs your game, with full control over how it looks. It's a React app in the `skins` folder of your release package.

![Installer template showing the install folder and shortcut options](https://mintcdn.com/directgvr/3pQ-TKp0IPKbsPvU/images/installer-skin/install-custom.png?fit=max\&auto=format\&n=3pQ-TKp0IPKbsPvU\&q=85\&s=652343b40fae86679c75503e4bf30064)

The installer template's custom install options

## Features

* Install, uninstall and repair wizards
* End user license agreement (EULA)
* Choice of install folder
* Desktop and Start menu shortcuts
* REST, proxy and web authentication
* Storage decryption key authentication
* Light and dark window themes
* Localization
* Customizable header image
* Custom JavaScript workflow tasks

## Requirements

* DIRECT 6.1 or newer
* Node 24

Players need:

| Operating system | Native browser |
| - | - |
| Windows | Internet Explorer 11 |
| macOS | Safari 13 |
| Ubuntu | WebKitGTK 2 |

## Run the skin while you develop

1. Use Node 24:

   ```bash theme={null}
   nvm install 24
   nvm use 24
   ```

2. Install the packages:

   ```bash theme={null}
   corepack enable
   pnpm install
   ```

3. Start the web server:

   ```bash theme={null}
   pnpm run start
   ```

4. Start the DirectGVR client, pointing it at the web server and the skin's `public` folder, where `app.yaml` is:

   ```bash theme={null}
   host.exe --devserver=http://127.0.0.1:3004/ --skin=c:\work\source\installer\public\ --debugfile --window --cef --devtools --disablesecurity
   ```

To debug the skin in Visual Studio Code, see [Debug the CEF client with VS Code](https://docs.directgvr.com/troubleshooting/debug-with-vscode.md).

## Package the skin

1. Build a production version:

   ```bash theme={null}
   pnpm run build
   ```

2. Pass the generated `build` folder to [builder.py](https://docs.directgvr.com/release-automation/builder-script.md) as `--skin_directory`.

## Command line

| Argument | Description |
| - | - |
| `--action=uninstall` | Opens the uninstall wizard. |
| `--action=repair` | Opens the repair wizard. |

With no arguments, the installer runs the `state` task to check whether the application is installed. If it isn't, the installer shows the install wizard; if it is, it shows the uninstall wizard.

## App config options

Set these in `public/app.yaml`:

| Name | Type | Description | Default |
| - | - | - | - |
| `compactInstall` | boolean | Show the compact interface (install button, options, progress bar, launch and close) instead of the full wizard. | false |
| `configPath` | string | Where to store the skin's settings. | `{localStorage}/{productType}.json` |
| `diskSpaceRequired` | integer | Bytes of disk space the install needs. `-1` skips the disk space check. | -1 |
| `hostnameWhitelist` | string or list | Host names allowed in URLs from the data store. | `[]` |
| `showBrowseScreen` | boolean | Show the folder selection screen. | true |
| `showEulaScreen` | boolean | Show the EULA screen. | false |
| `showLoginScreen` | boolean | Show the REST login screen. | false |
| `showSysCheckScreen` | boolean | Show the system requirements check screen. | false |
| `showWelcomeScreen` | boolean | Show the welcome screen. | true |
| `suggestedPath` | string | Suggested install folder. | `{userDownloads}` |

The EULA text is in `public/eula/` (`en.md` for English).

## Change the installer's name

The window title comes from the `Host` string in the localization files. In `public/locale/en.json`, change it to your installer's name, and do the same in every other language file you ship:

```json theme={null}
"Host": "My Game Installer",
```

## Default install folders

| System | Macro | Path | Needs elevation |
| - | - | - | - |
| Windows | `{programFiles}` | `C:\Program Files\` | Yes |
| Windows | `{userAppData}` | `C:\Users\USERNAME\AppData\Local\` | No |
| macOS | `{programFiles}` | `/Applications/` | No |
| Linux | `{programFiles}` | `/opt/` | No |

## How the install workflow works

The tasks are in `public/workflow.yaml`. Set your repository and executable in the `load` task:

```yaml workflow.yaml theme={null}
load:
  type: macro
  keyValuePairs:
    repository: mygame-{systemShortName}
    environment: production
    repositoryName: "{repository}.{environment}"
    aliasUrl: https://cdn.example.com/game/
    repositoryAliasUrl: "{aliasUrl}{repository}/alias.json"
    repositoryCatalogUrl: "{aliasUrl}{repository}/catalog/"
    appName: MyGame.app
    executableName-win: bin/mygame.exe
    executableName-mac: Contents/MacOS/mygame
    executableName-linux: bin/mygame
    shortcutName: My Game
    metafileDirectory: "{localStorage}"
```

### Elevation

`install` first checks whether the install folder is writable. If it isn't, such as `C:\Program Files`, it reruns the install actions elevated, which shows a User Account Control prompt on Windows:

```yaml theme={null}
installElevatedCheck:
  type: directoryIsWritable
  path: "{installDirectory}"
  recurse: true
  writable: installActions
  notWritable: installElevated
  progressWeight: 0
installElevated:
  type: workflowRun
  url: "{contentUrl}workflow.yaml"
  arguments: "{commandLine}"
  elevated: true
  start: installActionsElevated-{systemShortName}
  progressWeight: 0
```

To elevate as soon as the installer starts instead, set `requiresElevated: true` in `app.yaml`.

### Install actions

```yaml theme={null}
installActions:
  type: queue
  actions:
    - deleteMetafile
    - installSync
    - createShortcuts
    - copyInstaller-{systemShortName}
    - createSystemEntries-{systemShortName}
  progressWeight: 0
```

* `installSync` syncs your main repository.
* `createShortcuts` creates the desktop and Start menu shortcuts the player chose.
* `copyInstaller-*` copies the installer into the install folder so players can uninstall and repair later.
* `createSystemEntries-*` registers the application. On Windows, this adds the **Apps and Features** entry and the uninstall command:

```yaml theme={null}
createSystemEntries-win:
  type: registryKeyWrite
  hive: user
  location: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{productName}
  keyValuePairs:
    DisplayName: "{productName}"
    DisplayIcon: '"{pathJoin:{installDirectory},{executableName-{systemShortName}}}"'
    DisplayVersion: "{productVersion}"
    UninstallString: '"{pathJoin:{installDirectory},installer.exe}" --action=uninstall'
    InstallLocation: "{pathFix:{installDirectory}}"
    Publisher: "{companyName}"
    InstallSource: "{modulePath}"
    NoModify: 1
    NoRepair: 0
```

`productName`, `companyName` and `productVersion` come from the installer executable when it's compiled.

### Launch

The **Launch** button runs the `launch` task, which starts the file in `executableName-*` and closes the installer:

```yaml theme={null}
launch:
  type: queue
  actions:
    - readSystemEntries-{systemShortName}
    - launchApp
    - closeInstaller
launchApp:
  type: launch
  path: "{pathJoin:{installDirectory},{executableName-{systemShortName}}}"
  workingDirectory: "{installDirectory}"
  elevationRights: user
  successCode: 0
  waitForExit: false
```

## Install prerequisites

`public/prereqs.yaml` has tested tasks that check for, download and install common prerequisites. To use one, copy its tasks into `workflow.yaml` and add its first task before `installSync` in `installActions`:

```yaml theme={null}
installActions:
  type: queue
  actions:
    - deleteMetafile
    - prereqVC2017
    - installSync
    - createShortcuts
    - copyInstaller-{systemShortName}
    - createSystemEntries-{systemShortName}
```

| Software | Versions | Task |
| - | - | - |
| DirectX | June 2010 | `prereqDX2010` |
| Visual C++ | 2017 (32- and 64-bit) | `prereqVC2017` |
| Visual C++ | 2015 (32- and 64-bit) | `prereqVC2015` |
| Visual C++ | 2013 (32- and 64-bit) | `prereqVC2013` |
| Visual C++ | 2012 (32- and 64-bit) | `prereqVC2012` |
| Visual C++ | 2010 (64-bit) | `prereqVC2010` |
| .NET Framework | 2.0 | `prereqDotNet20` |
| .NET Framework | 3.5 | `prereqDotNet35` |
| .NET Framework | 4.0 | `prereqDotNet40` |
| .NET Framework | 4.5.1, 4.5.2 | `prereqDotNet451`, `prereqDotNet452` |
| .NET Framework | 4.6, 4.6.1, 4.6.2 | `prereqDotNet46`, `prereqDotNet461`, `prereqDotNet462` |
| .NET Framework | 4.7, 4.7.1, 4.7.2 | `prereqDotNet47`, `prereqDotNet471`, `prereqDotNet472` |

When the installer runs on a machine without a prerequisite, it installs it before syncing your game.

## Show a system notification

The `systemNotify` task shows a notification in the system tray:

| Argument | Type | Description | Default |
| - | - | - | - |
| `message` | string | Notification message | |
| `caption` | string | Notification title | `Host` |
| `icon` | string | `info`, `warning` or `error` | `info` |

```yaml theme={null}
showAllDoneNotification:
  type: systemNotify
  icon: info
  message: UI_Done
```

## Related

* [Launcher skin](https://docs.directgvr.com/launcher-design/launcher-skin.md)
* [Compile launchers with the builder script](https://docs.directgvr.com/release-automation/builder-script.md)
* [Tasks](https://docs.directgvr.com/reference/client-workflow-engine/tasks.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.