# Saleculator Vendor Deployment

This ZIP is the Saleculator runtime package for Windows, Linux, and Raspberry Pi/minimal Debian appliances. It does not require cloud access or annual renewal to run locally.

Customer releases are published at `https://www.saleculator.com/releases/` with release notes. Customers should normally download the installer for their version from saleculator.com, install it, configure MySQL/devices, and start using Saleculator. This runtime ZIP remains available for hardware vendors and technical deployments.

## Package Contents

- `dist/Saleculator.jar` - obfuscated application JAR.
- `lib/` - required Java libraries and native libraries.
- `config/Saleculator.properties.sample` - sanitized sample configuration.
- `SHA256SUMS.txt` - SHA-256 checksums for the application JAR and release metadata.
- `RELEASE-NOTES.md` - notes for this version and customer installation guidance.
- `RELEASE-CHECKLIST.md` - build, validation, smoke-test, and publish checklist.
- `PUBLIC-RELEASE-PAGE.md` - source content for the version page on saleculator.com.
- `AI-INSTALLATION-GUIDE.md` - step-by-step installation flow for AI assistants, support staff, and technicians.
- `scripts/run.bat` - Windows launcher.
- `scripts/run.sh` - Linux/Raspberry Pi launcher.
- `scripts/setup-saleculator.bat` and `scripts/setup-saleculator.sh` - guided first-run setup assistants.
- `scripts/preflight.bat` and `scripts/preflight.sh` - deployment checks.
- `scripts/setup-local-db.bat` - Windows local database setup for standalone/main POS.
- `scripts/setup-network-client.bat` - Windows network-client database configuration.
- `scripts/test-db-connection.bat` - Windows database connection test.
- `scripts/configure-db.sh` - Linux/Raspberry database setup helper.
- `scripts/support-info.bat` and `scripts/support-info.sh` - support information collection.
- `scripts/install-linux-appliance.sh` - minimal Debian/Raspberry Pi appliance installer.
- `deploy/linux/saleculator-kiosk.service` - systemd kiosk service template.
- `release-info.properties` - build and package metadata.

## Windows Deployment

1. Install Java 17 or newer.
2. Unzip this package to a permanent folder, for example `C:\Saleculator`.
3. Run the first-run setup assistant:

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

The assistant covers standalone/main POS, network-client setup, preflight, launch, and support-info collection. For a trial customer, start Saleculator and use the **START TRIAL** button on the activation screen to request the 30 day trial key.

Manual database setup is still available when needed.

Standalone/main POS:

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

Network client POS:

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

Advanced/vendor setup can still edit `%USERPROFILE%\Saleculator.properties` or use the in-app database configuration screen.

4. Run:

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

To use an explicit config:

```bat
scripts\run.bat C:\Saleculator\Saleculator.properties
```

## Linux Desktop Deployment

1. Install Java and database client tools:

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

2. Unzip this package, then run:

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

To use an explicit config:

```sh
scripts/run.sh /path/to/Saleculator.properties
```

## Raspberry Pi / Minimal Debian Appliance

Install expected packages:

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

Install Saleculator into appliance paths:

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

Edit `/etc/saleculator/Saleculator.properties`, then enable kiosk boot:

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

The appliance should boot to tty1, start X, and show the Saleculator PIN login screen without exposing a desktop.

## Configuration

Do not use live customer credentials in the sample file. Copy `config/Saleculator.properties.sample` to the deployed machine config path and set database, printer, scanner, scale, cash drawer, and optional remote access settings for that machine.

Common config paths:

- Windows: `%USERPROFILE%\Saleculator.properties`
- Linux desktop: `~/Saleculator.properties`
- Appliance mode: `/etc/saleculator/Saleculator.properties`

## Database Modes

The same Saleculator installation works for one machine or many counters.

- Standalone/main POS: database host is `localhost`.
- Network client POS: database host is the IP/name of the main POS or server.
- Multi-device setup: every counter points `db.URL` to the same database.

The setup scripts create/write the normal `Saleculator.properties` file. The in-app configuration screen can still change `db.URL` later.

If the application cannot connect to MySQL on startup, click **Database Settings**. The Database tab includes quick actions for local MySQL, network MySQL, and connection testing.

Business identity and receipt header/footer settings are stored in the shared MySQL resource `Business.Profile` when a database is available, so every POS counter connected to the same database uses the same business profile.

When the main POS database must serve other counters, configure MySQL to listen on the LAN interface and allow inbound TCP 3306 through the operating-system firewall. The provided setup scripts create the database/user and write Saleculator config; they do not change database server bind-address or firewall policy.

For a new empty MySQL database, Saleculator initializes schema and resources on first launch after the operator approves the database creation prompt.

## Support Info

When reporting a field issue, run:

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

or:

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

Attach the generated `support-info-*.txt` file. It records OS, Java, release metadata, package contents, selected config values, device visibility, and kiosk service status where available. It does not print configured password values.
