fix(server): report Windows service start and stop failures to the event log

A service has no console, and a refused data folder or server.json throws
before the server's log file exists, so the SCM recorded only error 1064
and the entry to check was lost. ServiceMain and the stop path now also
write the reason to the Application event log (source TitanoServer,
advapi32 ReportEventW, no message file registered). The Windows README
says where to look and that a data folder created by an unelevated
console run must be deleted or given to Administrators first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 15:51:22 +00:00
1 parent 32a0e9bbc1
commit 1dc93932cc
6 files changed
+134 -6

No files matched your search

+6 -3
View File
@@ -116,13 +116,16 @@ Choose the *Server* component in the setup, or unpack `Titano-Server-win-x64-<ve
The data folder is readable only by the server's account, SYSTEM and Administrators; without `TITANO_ADMIN_PASSWORD`
the first start writes a temporary admin password to `initial-admin-password.txt` there (open it from an
administrator prompt). Everything in it must belong to those accounts and nothing in it may be a link: otherwise the
server does not start and names the file to check. A new archive folder (default `C:\TitanoArchive`) can be changed
only by those accounts and read by other users; when other users can change an existing archive, the log says so.
server does not start and names the file to check (in the console, or for the service in Event Viewer › Windows Logs ›
Application, source `TitanoServer`). A new archive folder (default `C:\TitanoArchive`) can be changed only by those
accounts and read by other users; when other users can change an existing archive, the log says so.
Run `Titano.Server.exe` in a console, or install it as a Windows service from an administrator prompt with
`Titano.Server.exe --install-service` (remove it with `--uninstall-service`). The service runs as LocalSystem, so it
registers only from a copy inside `Program Files` that only administrators can change: install for *All users*, or
unpack the zip into a folder under `Program Files`.
unpack the zip into a folder under `Program Files`. A console run that was not elevated creates the data folder as your
own account, and the service then refuses it: delete the folder, or make Administrators its owner, before you start the
service.
## Translations