# Installation

> Install the East India service and the endia command line from one MSI, and decide who may use them.

East India installs from an MSI, as Docker Desktop installs from its own installer. Hyper-V must be enabled, and Windows must be build 26100 or later.

## Install

Each release on the [Releases page](https://github.com/teaToolkit/EastIndia/releases) has three MSIs:

| MSI | What it installs |
|---|---|
| `EastIndiaDesktop-<version>.msi` | The service, the command line `endia.exe` and the desktop app. Choose this for a developer's PC. |
| `EastIndiaService-<version>.msi` | The service and the command line, without the desktop app. |
| `EastIndiaCLI-<version>.msi` | The command line on its own. |

East India Desktop and East India Service each replace the other, because a PC runs one East India service. East India CLI installs beside either. The steps below install East India Desktop; the others install the same way.

1. **Download the MSI.** The MSI and the programs in it carry one version, which `endia --version` prints. It is `major.minor.patch`, and a later version always replaces an earlier one.
2. **Install it**, naming the image folder, which holds East India's Windows discs, disks and virtual machines:

   ```cmd title="Administrator prompt on the PC"
   msiexec /i EastIndiaDesktop-<version>.msi IMAGEFOLDER=M:\eastindia
   ```

   Windows asks for administrator rights. Opened this way, or by double-clicking the file, the MSI shows its progress and then a window that says whether the installation succeeded, failed or was cancelled. Without `IMAGEFOLDER`, the image folder stays as already configured, or is `C:\ProgramData\EastIndia\images` on a first installation. winget passes the same setting with `--custom "IMAGEFOLDER=M:\eastindia"`.
3. **Sign out and in again.** The installer adds you to the `eastindia-users` group, and Windows reads an account's groups only when it signs in.
4. **Check it.** `endia version` prints the versions of both the command line and the service.

## Installer

- **It copies the programs** to `C:\Program Files\EastIndia`, one folder per program, and puts `endia` on the system path. The command was called `eindia` until 10 November 2026. `eindia` still works as an alias of `endia` in this release and the next, so that existing scripts keep running, and is then removed.
- **It gives the programs the .NET 10 they run on.** The programs are published without .NET, so the MSI holds only East India's own files. Each program looks for .NET first in `C:\Program Files\EastIndia\dotnet`, then in the .NET installed in Windows. The installer downloads from Microsoft what is missing:
  - When `C:\Program Files\EastIndia\dotnet` exists, it adds any framework that folder lacks.
  - Otherwise, when the .NET installed in Windows has every framework, it downloads nothing.
  - Otherwise it downloads every framework into `C:\Program Files\EastIndia\dotnet`.

  It checks each download against the hash in Microsoft's release list. A download needs internet access; without it, the installation fails and is rolled back. The client needs only .NET itself. The server also needs ASP.NET Core and the Windows Desktop framework. The guest programs, which East India installs inside each machine's Windows, use the Windows Desktop framework, and `endia base prepare` copies the server's .NET into each new Windows for them.
- **It prepares the PC**, as a Linux package's post-install script does. It creates the `eastindia-users` group and adds you to it, and sets the image folder. It gives the local `eastindia` account, which East India signs in to Hyper-V as, access to Hyper-V, and creates East India's certificate authority. Each step changes only what differs, and every upgrade repeats them. It writes what it did to `C:\ProgramData\EastIndia\install.log`.
- **It installs and starts the Windows service `TeaToolkit.EastIndia`.** The service starts with Windows, and Windows restarts it 60 seconds after a failure.

To change the image folder later, run the MSI again with `IMAGEFOLDER` set to the new folder: the setup step then uses that folder in place of the configured one.

## Updating and uninstalling

**Updating** is installing a newer MSI. It stops and removes the installed service and programs, installs the new ones, prepares the PC again and starts the service. It keeps your images, records, certificates and the downloaded .NET. An older MSI refuses to install over a newer one.

**Uninstalling**, from Settings › Apps or with `msiexec /x EastIndiaDesktop-<version>.msi`, removes the programs, the service and the downloaded .NET. The downloaded .NET stays while East India CLI is still installed. Uninstalling leaves `C:\ProgramData\EastIndia`, the image folder, the `eastindia-users` group and East India's Hyper-V account.

A Windows service named `TeaToolkit.EastIndia` that was created by hand stops the MSI from installing its own. Remove it first, in an administrator prompt, with `sc.exe stop TeaToolkit.EastIndia` and then `sc.exe delete TeaToolkit.EastIndia`.

## Configuration

Configuration follows Docker's `daemon.json`. The settings are in `C:\ProgramData\EastIndia\config\policy.json`, which you edit in an administrator editor. The service reads the file only when it starts, so restart it afterwards with `sc.exe stop TeaToolkit.EastIndia` and then `sc.exe start TeaToolkit.EastIndia`. A key the service does not know, or a value out of range, stops it from starting, and the service log names the key. `endia info` prints every setting in effect, and the desktop app's Settings page lists the main ones under Service, with **Open settings file**.

## User access

Access works as it does in Docker Desktop:

- **On the PC, the `eastindia-users` group.** The service listens on the named pipe `\\.\pipe\eastindia_engine`, a channel that only programs on the same PC can open. Windows checks the account when `endia` opens the pipe, and grants access to members of `eastindia-users` and administrators, so no certificate is needed. Docker Desktop does the same with `\\.\pipe\docker_engine` and `docker-users`. To authorise another person, run `net localgroup eastindia-users <account> /add` in an administrator prompt; that person then signs out and in again.
- **From a sandbox, a client certificate.** A sandbox cannot open the PC's named pipe, so it connects over HTTPS, and the service checks its certificate when the connection opens. [Connecting an agent's sandbox](/docs/get-started/sandbox/) shows how.

Every authorised user may run every command.
