Skip to Content
On this page

Windows deployment

The Watchdog package includes TGateway. Verify a foreground launch from the complete directory before installing a Windows service. Do not run both instances together.

Prepare the installation

  1. Select Watchdog in Downloads and choose the package matching your Windows architecture.
  2. Install .NET 10 Runtime for that architecture. Use dotnet --list-runtimes to check for Microsoft.NETCore.App 10.x.
  3. Extract the entire package into a permanent location, such as D:\TGateway\WatchDog. Keep TGateway.Watchdog.exe, appsettings.json, GatewayApp, and all other bundled files.
  4. Give the runtime account read, execute, and data-write access. Do not run from a temporary extraction folder or download cache.

Gateway reference requirements are at least 512 MB RAM, preferably 1 GB or more, and 8 GB or more storage. Allocate additional space for the required log, history, and offline-cache retention; see Environment setup.

Foreground launch

Open a normal PowerShell or Windows Terminal and substitute your installation directory:

Set-Location 'D:\TGateway\WatchDog' .\TGateway.Watchdog.exe

The current programs inherit the launching account’s privileges; foreground startup does not require administrator rights. Grant directory, serial-device, or site-specific permissions to that account as needed. Elevate the terminal when installing the system service.

Leave the window open. Visit http://localhost:6200, confirm the gateway is running on the Watchdog dashboard, and then open http://localhost:6100. Follow Start and sign in for credentials and workspace identification.

After local access works, test from another computer using the host IP. Check listeners and Windows Firewall if remote access fails. Web and device-protocol ports are separate checks.

Install the Windows service

End the foreground Watchdog with Ctrl+C and wait for it to exit. Open PowerShell as administrator:

$watchdogExe = 'D:\TGateway\WatchDog\TGateway.Watchdog.exe' sc.exe create TGatewayWatchdog binPath= "`"$watchdogExe`"" start= auto DisplayName= "TGateway Watchdog" sc.exe start TGatewayWatchdog sc.exe query TGatewayWatchdog Get-Service TGatewayWatchdog

Expect RUNNING from sc.exe query and Running from Get-Service. Reopen both Web pages. A running service does not establish that device data is correct.

This example uses LocalSystem by default. To use a dedicated account, configure Services → TGateway Watchdog → Properties → Log On and grant that account access to the installation, project data, and required devices. A service cannot rely on drive mappings from another user’s interactive session.

Watchdog uses its own program directory and the adjacent GatewayApp. If you move the installation, update the executable path in the service registration.

Logs and service management

LocationPurpose
Watchdog Web LogsProcess startup, health checks, and project operations
Logs/Watchdog/Default Watchdog file logs, relative to its installation
GatewayApp/Logs/XTrace/Default gateway process logs; the gateway logging configuration is authoritative
Windows Event ViewerSystem and Application events for service startup failures

Run service controls only within an appropriate maintenance window:

sc.exe stop TGatewayWatchdog sc.exe start TGatewayWatchdog sc.exe query TGatewayWatchdog

After arranging shutdown and backup, unregister the service with:

sc.exe stop TGatewayWatchdog sc.exe delete TGatewayWatchdog

Unregistering does not delete the installation or project data. Wait for the process to exit before replacing files.

Update and recovery

For gateway program updates, prefer Studio’s batch gateway update. Select the correct platform, then check both the version and business data.

When updating the Watchdog host or moving the complete installation:

  1. Create a Watchdog backup and download it elsewhere.
  2. Record service path, account, and ports. Stop the service in a maintenance window.
  3. Preserve a copy of the stopped installation, including appsettings.json, GatewayApp, CurrentProject, Projects, and Backups. Do not copy only a SQLite main file while the gateway is writing.
  4. Follow the release instructions to replace programs while preserving site configuration and data. Do not overwrite site databases with initial databases from the new package.
  5. Start the service and verify Watchdog state, Runtime version, active project, a known variable, and new data at the actual destination. If recovery is required, retain logs before restoring the saved installation and original service path.

Startup problems

SymptomCheck and recovery
Missing .NET runtimeMatch runtime version and process architecture, install it, then restart
Access is deniedIdentify the failing file or device and grant access to the actual service account
Address already in useCheck for simultaneous foreground and service instances; do not terminate an unidentified process
Service immediately stopsRead file logs and Event Viewer, then stop the service and launch in the foreground to inspect the full error
Web works but device reads failFollow collection diagnosis for the actual protocol path

See Troubleshooting for other symptoms.