# ImageAnywhere Field Setup

Package: ImageAnywhereFieldSetup-1.9.302.0-20260809-204256

This ZIP includes the ImageAnywhere app package and the optional current-user companion agent package.

Clinical Appliance Mode is OFF for this ZIP. Ordinary app close behavior remains unchanged unless support explicitly supplies -EnableClinicalApplianceMode together with -EnableAgentStartupTask.

## Standard Field Install

1. Extract this ZIP fully (right-click the ZIP, "Extract All..."). Do not run anything from inside the un-extracted ZIP.
2. Stay signed in as the Windows user who will use ImageAnywhere. Any admin approval must be for this SAME account - elevating as a different account would land the install on the wrong user, and the installer stops if it detects that.
3. Right-click `INSTALL-ImageAnywhere.cmd` and choose **Run as administrator** (choose Open/Run if Windows shows a security prompt). Even from an elevated window, the agent is started in the normal user context via the sign-in task.
4. If your Windows account is not an administrator, double-click `INSTALL-ImageAnywhere.cmd` instead. On a brand-new machine Windows will then show ONE admin (UAC) prompt to trust the app certificate; approve it or have site IT approve it - the install itself stays on the signed-in user.
5. Keep the window open until it says **Install finished and verified**, then sign in to ImageAnywhere, click **Pair agent**, then **Refresh agent** in Connections. The agent imports pairing on its next heartbeat, so allow 5-10 minutes and click **Refresh agent** again. A healthy setup shows `Always-on agent` with `Agent healthy`.

The window logs everything to `field-install-log.txt` beside the scripts and writes `field-setup-result.json` / `field-verify-result.json`. If it says INSTALL DID NOT FINISH, send `field-install-log.txt` to support.

That installer:
- trusts the app signing certificate (one-time admin approval only if the machine has never trusted it)
- installs or updates the packaged ImageAnywhere app for the signed-in user
- installs or upgrades the companion agent in place (existing pairing preserved)
- registers the current-user sign-in task (no time limit, no elevation needed), then starts the agent hidden - when the install window is elevated, the agent is started through that task so it still runs as the normal signed-in user
- launches ImageAnywhere and runs a full verification ending in a VERDICT: PASS / FAIL line

## Verify Later

Double-click `VERIFY-ImageAnywhere.cmd` (read-only). It prints `VERDICT: PASS` or `VERDICT: FAIL (reasons)` and writes `field-verify-result.json`.

Manual alternative from a PowerShell window in this folder:

    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Install-ImageAnywhereField.ps1 -EnableAgentStartupTask
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Verify-ImageAnywhereField.ps1 -RequireStartupTask

Readiness-only preview (writes evidence JSON but performs no install, settings, task, start, or launch mutation):

    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Install-ImageAnywhereField.ps1 -EnableAgentStartupTask -DryRun

Read-only M6/M8 health evidence after install (does not change settings, tasks, processes, packages, or connectivity):

    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Get-ClinicalApplianceReadiness.ps1 -MachineAlias CA-DEMO-XX -ExpectedSupervisionMode Any -RequireSupervisionEnabled -RequireAgentTask -OutputPath .\clinical-appliance-readiness.json

## Clinical Appliance Rollback

Run `Rollback-ClinicalApplianceMode.ps1` to set only `ClientSupervision.Enabled=false` while preserving the rest of agent settings, pairing state, diagnostics, UWP LocalState, and clinical queues. Restarting/removing the agent or deleting the sign-in task remains a separate, explicitly approved operation.

## Important Boundaries

- This is a current-user install path. It is designed for the Windows user who signs into ImageAnywhere.
- The scheduled task starts the agent at that user's Windows sign-in. It is not a machine service and does not run before any user signs in.
- True service-account or pre-login operation needs the future node-credential design.
- Use `-ReplaceExistingApp` only when support deliberately wants to remove and reinstall the current user's app package.
