Platform, Architecture & Foundations
How SamvraCore ERP is built, packaged, licensed, isolated per tenant, and internationalised.
4. Cross-Platform Distribution and In-App Updates
Five platform builds
The product ships for five distribution platforms: Linux amd64, Linux arm64, macOS Apple Silicon (arm64), macOS Intel (amd64), and Windows amd64. Linux uses a systemd service and tarball installer (User=samvracore, Restart=always). macOS ships as a single binary. Windows uses an NSIS installer plus a Windows service run through the SCM dispatcher in golang.org/x/sys/windows/svc.
Windows service specifics
On Windows the installer asks the operator for a data folder, writes SAMVRACORE_DATA_DIR as a system environment variable and as a per-service Environment REG_MULTI_SZ entry so the SCM-launched service sees env vars without a reboot, and configures an sc failure auto-restart policy. Boot-trace logging across candidate paths and service-log redirection to service.log help diagnose SCM or systemd start failures.
Admin-triggered updates
Updates are driven from the admin UI (the Updates page) through three endpoints under /api/v1/admin/updates for status, check, and install. The update manifest is fetched from https://downloads.samvracore.tech/samvracore-erp/latest.json. The install path verifies a SHA-256 checksum, swaps the binary in place, flushes the response after about 1.5 seconds, calls os.Exit(0), and lets systemd or the Windows SCM respawn the new binary. Build targets include make dist and per-platform variants, and slim variants exclude the GCS and Azure SDKs to reduce binary size.