# Desktop Update Management & Rollback

In live stage lighting, touring productions, and theatrical performances, **stability is paramount**. An unexpected software change or automatic reload right before doors open is every lighting technician's worst nightmare. 

Unilighter Desktop features a dedicated **Update Management & Rollback** system designed specifically for the realities of live production. It gives you full authority over when updates are installed, keeps multiple previous versions ready for instant offline rollback, and includes a standalone **Emergency Recovery Page** (`!!Ctrl+Shift+E!!`) that functions even if the console interface freezes.

---

## 🔒 Why Update Management Matters for Live Shows

### 1. The "Show Freeze" Rule
During a tour, festival weekend, or theatrical run, professional lighting directors practice a strict **Show Freeze**:
- Once a lighting show is programmed, rehearsed, and approved during tech week, **the console software must remain locked**.
- Unilighter Desktop lets you disable automatic background installation with a single toggle. The console will never reload itself or update without your explicit permission.

### 2. Zero-Risk Rehearsal Upgrades
When new features or fixture profiles (such as Washers, Pars, or moving heads) are released:
- You can safely update during pre-production or soundcheck.
- If an unforeseen change affects your workflow or a fixture profile behaves unexpectedly, you can **roll back to your previous working version in 2 seconds** with a single click.

### 3. Full Offline Resilience
- Venues located in underground clubs, arena tunnels, or outdoor fields often lack reliable internet.
- Unilighter stores previously downloaded versions directly on your computer's local drive. You can switch between stored versions **completely offline** without needing an internet connection.

---

## 📦 How Version Storage Works

Unilighter Desktop manages versions locally so you are always protected:

- **Retains the Last 5 Versions**: The application automatically stores up to 5 recent versions locally on your hard drive.
- **Offline Switching**: All cached versions are complete, self-contained packages. You can activate any of the 5 saved versions at any time, even in airplane mode.
- **Disk Storage Management**: The app efficiently reuses unchanged assets between versions. If you ever wish to free up drive space, you can delete older cached builds individually with one click.

---

## ⚙️ Configuring Update Behavior

You can choose how Unilighter Desktop handles new releases via **Settings $\rightarrow$ Desktop**:

### Mode A: Automatic Background Preparation (Default)
- **Setting**: *Automatically install console updates* is **checked**.
- **Behavior**: Unilighter quietly checks for updates in the background (approximately every 30 minutes). When an update is ready, it downloads the assets silently in the background without affecting your active DMX output or fader response.
- **Notification**: A discrete toast notification appears in the lower-right corner of the screen:
  > **System updated** — [Reload]
- **Your Choice**: The app **never** reloads automatically. You decide when to click **Reload** (such as between sets, during intermission, or after the show).

### Mode B: Manual Update Mode (Show Freeze)
- **Setting**: *Automatically install console updates* is **unchecked**.
- **Behavior**: Unilighter checks if a new version exists, but **does not download it automatically**.
- **Notification**: When an update is detected, a toast notification informs you:
  > **An update is available** — [Install and reload]
- **Your Choice**: No data is downloaded and no files are touched until you choose to click the button.

> [!TIP]
> **Touring Best Practice**:
> Uncheck *Automatically install console updates* on your primary show laptop before leaving for a gig. Keep it frozen throughout the tour, and perform updates only during scheduled rehearsal days.

---

## 🚨 The Emergency Recovery Page (`!!Ctrl+Shift+E!!` / `!!⌘⇧E!!`)

The **Emergency Page** is your safety net. It is an independent, low-level recovery interface built directly into Unilighter Desktop.

```
┌────────────────────────────────────────────────────────┐
│              Unilighter Desktop Emergency              │
│  Update settings and version rollback. Ctrl+Shift+E    │
├────────────────────────────────────────────────────────┤
│  [ Open console ]  [ Refresh ]                         │
│                                                        │
│  Console updates                                       │
│  [✓] Automatically install console updates             │
│  Current: 260905120000a1                               │
│  [ Download latest ]                                   │
│                                                        │
│  ┌──────────────────────────────────────────────────┐  │
│  │ 260905120000a1 [current]   [Activate]  [Delete]  │  │
│  └──────────────────────────────────────────────────┘  │
│  ┌──────────────────────────────────────────────────┐  │
│  │ 260828143000f4             [Activate]  [Delete]  │  │
│  └──────────────────────────────────────────────────┘  │
└────────────────────────────────────────────────────────┘
```

### Why It Is Unique: Total UI Independence
Standard web applications fail completely if a script error occurs or a corrupt file causes a blank screen. 
- The Emergency Page **does not depend on the main console application**.
- Even if the console screen freezes, turns white, or fails to render, the Emergency Page **always opens**.

### How to Access the Emergency Page
- **Global Keyboard Shortcut**: Press **`!!Ctrl+Shift+E!!`** (Windows & Linux) or **`!!⌘⇧E!!`** (macOS) from anywhere in the application.
- **From App Settings**: Go to **Settings $\rightarrow$ Desktop** and click **Open update manager**.
- **Quick Return**: Pressing **`!!Ctrl+Shift+E!!`** (or **`!!⌘⇧E!!`**) while on the Emergency Page immediately returns you to the active console.

---

## 🛠️ What You Can Do on the Emergency Page

### 1. Instant 1-Click Rollback
The page displays a list of all cached versions stored on your machine.
- Each version card displays its identifier, total file count, and download date.
- The currently active build is marked with a blue **`!!current!!`** badge.
- To roll back to an earlier version, simply click **Activate** next to that build.
- Click **Open console** (or press `!!Ctrl+Shift+E!!`): the console reopens instantly running the selected version.

### 2. Manual Update Download
- If you have an internet connection and want to fetch the latest release, click **Download latest**.
- Unilighter will fetch the latest build and add it to your local list, ready for activation.

### 3. Toggle Auto-Update Preferences
- Check or uncheck **Automatically install console updates** directly from this screen.
- This allows you to lock your console even if you cannot access the main settings screen.

### 4. Delete Unused Versions
- Click **Delete** next to any inactive version to remove it from your local storage and free up disk space.
- The active version cannot be deleted while in use.

---

## 📋 Operator Playbook: Common Scenarios

### Scenario 1: Pre-Tour "Show Freeze" Checklist
1. Open **Settings** (`⚙️`) $\rightarrow$ **Desktop**.
2. Uncheck **Automatically install console updates**.
3. Press **`!!Ctrl+Shift+E!!`** to open the Emergency Page.
4. Verify that your current stable version is marked as **`!!current!!`**, and confirm that at least one known-good previous version is listed below it.
5. Press **`!!Ctrl+Shift+E!!`** to return to your workspace. Your system is now frozen and ready for the road.

### Scenario 2: Emergency Rollback During Tech Rehearsal
1. Suppose an update was applied and you encounter an unexpected issue with a fixture profile (e.g. Washers or Pars).
2. Press **`!!Ctrl+Shift+E!!`** immediately.
3. Locate the previous version in the list and click **Activate**.
4. Click **Open console**. The console immediately boots into the previous version with all your show files intact.

