# Saleculator Deployment Validation

Use this checklist for every runtime ZIP before giving it to a hardware vendor or installing it on a customer machine.

## Package Validation

From the source tree, create the runtime ZIP:

```bat
scripts\package-release.bat
```

or:

```sh
scripts/package-release.sh
```

Then validate the package structure:

```bat
scripts\validate-runtime-package.bat release\saleculator-<version>-runtime.zip
```

or:

```sh
scripts/validate-runtime-package.sh release/saleculator-<version>-runtime.zip
```

The validator checks for the obfuscated JAR, `lib`, launchers, first-run setup assistants, preflight scripts, support scripts, AI/customer installation instructions, vendor documentation, release notes, sample config, release metadata, checksums, and Linux appliance service files.

## Release Website Publication

For each public release, publish the customer-facing artifacts at `https://www.saleculator.com/releases/`:

- Windows installer for the version.
- Runtime ZIP for vendors/technical deployments.
- `RELEASE-NOTES.md` content or equivalent web release notes.
- `RELEASE-CHECKLIST.md` completed for the version.
- `PUBLIC-RELEASE-PAGE.md` adapted to the published web page.
- SHA-256 checksum information.
- Public JSON release metadata:
  - `https://www.saleculator.com/releases/<version>/release.json`
  - `https://www.saleculator.com/releases/latest.json`
  - `https://www.saleculator.com/downloads/latest.json`

Customers should be able to download their version installer, install, run First Run Setup, request a 30 day trial key when needed, configure MySQL and devices, and use Saleculator without a technician for normal single-machine setups.

After upload, verify the JSON endpoints return HTTP 200 and that their artifact URLs, file sizes, and SHA-256 hashes match the final published installer/runtime ZIP and `SHA256SUMS.txt`. Also confirm Windows installer signature metadata and `installPolicy` are correct before telling customers to install.

## Windows Clean Install Test

Target: a clean Windows POS machine or VM.

1. Install Java 17 or newer.
2. Unzip `saleculator-<version>-runtime.zip` into `C:\Saleculator`.
3. Run the guided setup assistant:

```bat
scripts\setup-saleculator.bat
```

4. Confirm the assistant offers standalone/main POS, network-client setup, database test, preflight, launch, and support-info collection.
5. Run one manual database mode setup if the guided flow needs direct validation:

Standalone/main POS:

```bat
scripts\setup-local-db.bat
```

Network client POS:

```bat
scripts\setup-network-client.bat
```

If the standalone/main POS also serves other counters, confirm MySQL is listening on the LAN interface and that TCP 3306 is allowed through the firewall before testing network clients.

6. Configure printer, scanner, scale, and cash drawer values for the machine.
7. Run:

```bat
scripts\preflight.bat
```

8. Confirm preflight has no hard failures.
9. Run:

```bat
scripts\run.bat
```

10. If the activation screen appears, confirm **START TRIAL** opens the trial-key request path and that a valid 30 day trial key can be activated.
11. Confirm the Saleculator PIN login screen appears after activation.
12. For a new empty database, approve Saleculator's database creation prompt and confirm resources are created.
13. Login with a test user and verify the default PIN change prompt appears if using seeded credentials.
14. Run:

```bat
scripts\support-info.bat
```

15. Confirm the generated `support-info-*.txt` masks passwords and contains useful package, Java, config, and device information.

## Windows Installer Test

Target: a non-technical Windows install flow.

1. Build the installer:

```bat
scripts\build-windows-installer.bat
```

2. Run `release\Saleculator-<version>-Setup.exe`.
3. Confirm the installer has a valid digital signature before customer publication:

```bat
scripts\verify-installer-signature.bat release\Saleculator-<version>-Setup.exe
```

4. Confirm shortcuts are created.
5. Select First Run Setup after install.
6. Confirm First Run Setup opens in a command window and can configure standalone/main POS or network-client mode.
7. Confirm a trial user can reach the activation screen, request a 30 day trial key with **START TRIAL**, activate the key, and reach the PIN login screen.
8. Run Saleculator from the desktop shortcut.
9. Confirm the same standalone and network-client scenarios work.

## Linux Desktop Clean Install Test

Target: clean Debian/Raspberry Pi OS desktop machine.

1. Install packages:

```sh
sudo apt-get update
sudo apt-get install openjdk-17-jre mysql-client
```

2. Unzip `saleculator-<version>-runtime.zip`.
3. Run:

```sh
chmod +x scripts/*.sh
scripts/setup-saleculator.sh
scripts/configure-db.sh network SERVER-IP SALECULATOR saleculator
scripts/preflight.sh
```

4. Confirm the guided setup assistant offers standalone/main POS, network-client setup, database test, preflight, launch, and support-info collection.
5. Confirm preflight has no hard failures.
6. Run:

```sh
scripts/run.sh
```

7. If the activation screen appears, confirm **START TRIAL** opens the trial-key request path and that a valid 30 day trial key can be activated.
8. Confirm the Saleculator PIN login screen appears after activation.
9. Run:

```sh
scripts/support-info.sh
```

10. Confirm the generated support file masks passwords and includes device visibility.

## Minimal Debian / Raspberry Pi Appliance Test

Target: minimal Debian or Raspberry Pi OS device intended to behave as a Saleculator appliance.

1. Install packages:

```sh
sudo apt-get update
sudo apt-get install openjdk-17-jre xserver-xorg xinit unclutter mysql-client
```

2. Unzip `saleculator-<version>-runtime.zip`.
3. Run:

```sh
chmod +x scripts/*.sh
scripts/preflight.sh
```

4. Install appliance files:

```sh
sudo sh scripts/install-linux-appliance.sh
```

5. Edit `/etc/saleculator/Saleculator.properties`.
6. Enable kiosk boot:

```sh
sudo sh scripts/install-linux-appliance.sh --enable-kiosk
sudo reboot
```

7. Confirm the machine boots to tty1, starts X, and shows the Saleculator PIN login screen without exposing a desktop.
8. Confirm keyboard/touch/barcode input works on the PIN screen.
9. Confirm reboot and power-loss recovery return to the PIN login screen.
10. Run support info after login or from a shell:

```sh
scripts/support-info.sh /etc/saleculator/Saleculator.properties
```

## Hardware Validation

Record every tested device in `HARDWARE-COMPATIBILITY.md`.

Minimum test set:

- Receipt printer: print test receipt, open cash drawer pulse if applicable.
- Barcode scanner: scan product barcode into sale screen.
- Scale: read stable weight and verify unit conversion.
- Cash drawer: open from sale/payment workflow.
- Customer display/KDS if used.
- Network: database connection survives reboot.
- Appliance boot: no visible desktop or shell for normal operators.
