VDI Access Manager Agent 26.10.915.0 - Installation
====================================================

Installer: vma-Setup-26.10.915.0.exe
Requires:  Windows 10 or later, x64, administrator rights.
The agent is installed as the Windows service "VDI Access Manager Agent" (LocalSystem, automatic start).


1. New installation (silent)
----------------------------

vma-Setup-26.10.915.0.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SERVERURL=https://<agent API address> /TOKEN=<enrollment token>

Required for a new installation:
  /SERVERURL=<address>   Address of the agent API. Must start with https:// and must not contain spaces.
  /TOKEN=<token>         Enrollment token of the tenant (created with the DevTool or in the console).
                         A token is valid for 30 days and is only used for the first enrollment.

Optional:
  /DRYRUN=1              Dry-run mode: actions with a system-wide effect (such as a restart) are logged
                         and reported as done, but not performed. Useful for a first test.
                         Without this parameter the agent runs in production mode.
                         Accepted values for dry-run mode: 1, true, yes.

When /SERVERURL or /TOKEN is missing or invalid, the installation stops without changes (exit code 7).


2. Upgrade (silent)
-------------------

vma-Setup-26.10.915.0.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART

- An existing installation is detected automatically. agent.json, the device identity (identity.bin)
  and the state (state.json) are kept; /SERVERURL, /TOKEN and /DRYRUN are ignored.
- The service is stopped before the files are replaced and started again afterwards.
- When the upgrade is aborted, the files are rolled back and the previous version is started again.

Upgrade through VDI Access Manager (Install policy):
  Arguments:      /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
  Detection rule: reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E2D5B7A-3F41-4C96-A0D8-1B6C9E4F7A25}_is1\DisplayVersion=26.10.915.0

  The update stops the agent itself. The installation continues regardless; after the restart the
  agent evaluates the detection rule and reports the result of the job. Agents older than the
  self-update support (before 26.10) abort their own update: those devices are upgraded once by hand
  or through another deployment tool.


3. Standard Inno Setup parameters
---------------------------------

  /VERYSILENT            No wizard and no progress window.
  /SILENT                No wizard, but a progress window is shown.
  /SUPPRESSMSGBOXES      Suppresses message boxes (answers them with the default).
  /NORESTART             Never restarts the device (the agent does not require a restart).
  /LOG="<file>"          Writes a setup log, for example /LOG="C:\Windows\Temp\vma-setup.log".
  /DIR="<folder>"        Other installation folder. Default: C:\Program Files\PNQ Software\VDI Access Manager Agent


4. Uninstallation (silent)
--------------------------

"C:\Program Files\PNQ Software\VDI Access Manager Agent\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES

  /PURGEDATA             Also removes the configuration, keys and device identity.
                         Without this parameter the data folder is kept, so a later installation
                         continues as the same device.

The service is stopped and removed. The device itself stays visible in the console until it is
deleted there.


5. Exit codes
-------------

  0   Success.
  1   Setup failed to initialize.
  2   Cancelled before the installation started.
  3   Fatal error while preparing the installation.
  4   Fatal error during the installation.
  5   Cancelled during the installation.
  6   Setup was terminated.
  7   Setup cannot proceed (for example a missing or invalid /SERVERURL or /TOKEN).
  8   Setup cannot proceed until the device is restarted.


6. Files and settings
---------------------

Program folder:  C:\Program Files\PNQ Software\VDI Access Manager Agent
Data folder:     C:\ProgramData\PNQ Software\VDI Access Manager Agent  (SYSTEM and Administrators only)
  agent.json     Configuration (written at a new installation only)
  identity.bin   Device identity after enrollment
  state.json     Processed jobs and pending results
  keys\          Public keys of the server

Settings in agent.json (section "Agent"):
  ServerUrl              Address of the agent API.
  EnrollmentToken        Used once for enrollment.
  AllowInsecureHttp      false. Only for local development.
  DryRun                 false (default) or true (see /DRYRUN).
  VasIniPath             Empty: vas.ini is detected automatically in every user profile.
  ProfileUsers           Limits automatic detection to these profile folder names, for example ["kiosk"].
  ShowNotice             true (default): a full-screen "Performing upgrade" notice is shown to the
                         signed-in user during install and uninstall jobs. Ctrl+Alt+Del keeps working.
  NoticeTimeoutMinutes   30 (default): the notice closes itself after this time at the latest.

ShowNotice and NoticeTimeoutMinutes are not written by the installer; without them the defaults apply.
Changes to agent.json take effect after a restart of the service:
  net stop "VDI Access Manager Agent" & net start "VDI Access Manager Agent"


7. Moving a device to another tenant
------------------------------------

1. Delete the device in the console of the current tenant.
2. On the device: replace EnrollmentToken in agent.json with a token of the new tenant.
3. Restart the service. The agent enrolls in the new tenant, in the group "All devices".


8. Troubleshooting
------------------

- The service does not start: the Windows event log (Application) shows the reason, for example an
  invalid server address in agent.json.
- The service restarts automatically after a failure: after 1 minute, up to three times per day.
- Setup log: run the installer with /LOG="<file>".
