Install on Windows¶
The Windows edition is one Windows service that reads X-keys keypads and Advantech digital-input cards and serves the TriggerGate hub and the web page. It is installed with Chocolatey from the TriggerGate.Windows package. During pre-release the package is supplied on request: get in touch.
What you need¶
| Item | Requirement |
|---|---|
| Computer | 64-bit Windows (x64). The service runs as a 64-bit process. |
| Chocolatey | A licensed Chocolatey installation. The package depends on the chocolatey-license package and installs the service with Chocolatey's licensed service commands. |
| Package source | The Chocolatey source you were given with the package, added to Chocolatey. |
| .NET | Nothing to install by hand. Chocolatey installs the .NET 11 runtime and the ASP.NET Core 11 runtime as dependencies. |
| Advantech cards | Advantech's DAQNavi runtime, installed before TriggerGate. It provides the card drivers and biodaq.dll. TriggerGate does not include it. |
| X-keys keypads | Nothing beyond the HID driver Windows already has. |
Install DAQNavi first if the computer has an Advantech card. With the default setting, the service runs its Advantech platform only when the DAQNavi runtime is installed, and runs X-keys in any case. See Platforms and devices for how the service chooses.
Install¶
In an elevated PowerShell:
The installer:
- Creates
%ProgramData%\GameshowPro\TriggerGateand itslogsfolder, and gives theNT AUTHORITY\LocalServiceaccount Modify rights on them. - Installs the Windows service
TriggerGate.Windows(display name "TriggerGate Windows" followed by the version), set to start automatically and to run asNT AUTHORITY\LocalService. - Adds an inbound Windows Firewall rule, "Allow TriggerGate.Windows", for the service's program, on the Private network profile only.
Check that it is running:
First start¶
On the TriggerGate computer itself, open http://localhost:9090/. That address needs no certificate.
From another computer, the web page needs HTTPS, because browsers start its .NET WebAssembly runtime only on a secure page. Opening the computer's address on port 9090 from another computer takes you to the certificate page, where you install TriggerGate's certificate once and continue to the secure address on port 9190. See Open the web page over HTTPS.
The web page's Service panel shows the state of each platform. "GPIO System" turns green when a device is open. If it stays red, its text says why; Troubleshooting lists the messages.
Applications connect to the hub at http://<computer>:9090/TriggerGate. See .NET client library.
Where things are¶
| What | Where |
|---|---|
The service program and appsettings.json |
%ChocolateyInstall%\lib\TriggerGate.Windows\binaries |
| Settings of each platform | %ProgramData%\GameshowPro\TriggerGate\settings.AdvantechWindows.json, settings.XKeysWindows.json (and settings.XKeysWindows.<N>.json for a second or later X-keys device) |
| Service log | %ProgramData%\GameshowPro\TriggerGate\logs, one file per UTC day, the last four kept. See Read the service log. |
| HTTPS certificate authority and keys | %ProgramData%\GameshowPro\TriggerGate\tls |
| Port | Use |
|---|---|
| 9090 (HTTP) | The hub at /TriggerGate, used by applications. The web page on this computer, and the certificate page for other computers. |
| 9190 (HTTPS) | The web page from other computers. |
The service also advertises its hub on the local network over mDNS as _gp-triggergate._tcp, so the find button in client applications lists it.
Settings in appsettings.json¶
appsettings.json, next to the service program, holds the service-wide settings. Restart the service after changing it:
Setting under TriggerGate |
Default | Effect |
|---|---|---|
WindowsDevice |
Auto |
Which device families run. Auto: Advantech when the DAQNavi runtime is installed, and X-keys always. XKeys or Advantech: only that family. See Platforms and devices. |
InterruptDiscriminationMicroseconds |
150 |
How close two interrupt edges on an Advantech card can be before they are treated as tied. See Triggers and faceoffs. |
EdgeHandoffWarnMilliseconds |
5 |
The service logs a warning for any edge report that takes longer than this, on its own clock, from the edge to the hand-off to the network. 0 turns the warning off. |
FaceoffIdleStates |
EnsureDisabled |
Whether the service disables processor idle states while a faceoff is armed. LeaveAlone never changes them. See Processor idle states during faceoffs. |
ServicePort |
9090 |
The plain HTTP port of the hub and the web page. |
WebUiPort |
none | An optional separate port for the web page. See HTTPS settings. |
HttpsPort |
9190 |
The HTTPS port. 0 turns HTTPS off. See HTTPS settings. |
TlsStorageDirectory |
%ProgramData%\GameshowPro\TriggerGate\tls |
Where the HTTPS certificate authority and keys are kept. See Where the keys are kept. |
CertificatePath, CertificateKeyPath, CertificatePassword |
none | A certificate of your own to serve instead of the one from TriggerGate's certificate authority. See Use your own certificate. |
The same settings can also be given as environment variables of the service (TriggerGate__HttpsPort=0) or as command-line arguments (--TriggerGate:HttpsPort=0), which take precedence over appsettings.json. The service's log file settings are in NLog.config, next to appsettings.json; see Device log.
appsettings.json is a file of the package, not of your data folder. Keep a note of any change you make to it.
Upgrade¶
Chocolatey stops the service before it changes any files, then installs the new version. Settings, logs and the HTTPS identity in %ProgramData%\GameshowPro\TriggerGate are not part of the package and are kept, so computers and phones that trust TriggerGate's certificate keep trusting it.
Uninstall¶
This removes the service and its firewall rules. The folder %ProgramData%\GameshowPro\TriggerGate, with its settings, logs and HTTPS identity, is left in place. Delete it by hand if you do not need it.
Service account and privileges¶
The service needs no administrative rights. It opens X-keys and DAQNavi devices from user mode, binds its ports without URL reservations, and writes only under %ProgramData%\GameshowPro\TriggerGate, where the installer gave its account Modify rights.
If an Advantech card's driver refuses access to LocalService, run the service as LocalSystem instead: in Services, open TriggerGate Windows, choose Log On, select Local System account, and restart the service. The HTTPS identity's keys are protected for the account that created them, so after the change HTTPS stops working until you reset the identity; see If it does not work.
What the service changes on the computer¶
- The firewall rule above, created at install and removed at uninstall. It covers the Private network profile only. On a network that Windows classifies as Public or Domain, other computers cannot reach the service until you allow it there.
- Processor idle states, while a faceoff is armed. By default the service disables processor idle states in the active power scheme while any faceoff or pre-faceoff is armed, and puts the previous value back 5 seconds after the last one ends. See Processor idle states during faceoffs.