# Update Architecture Guide

`install.ps1` checks `/api/packages/{product}/latest?channel={channel}` to find the latest package for the selected product and channel.

The update flow is:

1. Select product and release channel.
2. Read latest package metadata from the API endpoint.
3. Compare the latest version with local state under `C:\ProgramData\AtiqSoft\Installed`.
4. Offer install or update.
5. Download the declared package URL.
6. Validate file size and SHA256.
7. Run the installer with the package command line arguments.
8. Log install, update, download, and failure events under `C:\ProgramData\AtiqSoft\InstallLogs`.

Enterprise deployments can call the script with `-ProductId`, `-Channel`, `-Quiet`, and `-CheckOnly` for controlled rollout checks.
