Skip to content

Commit 2642270

Browse files
authored
feat: auto sync clock (#339)
1 parent eac9a7f commit 2642270

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

guest_server/install.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@echo off
22
set INSTALL_DIR=C:\Program Files\WinBoat
33
set EXE_PATH=%INSTALL_DIR%\winboat_guest_server.exe
4+
set TIME_SYNC_SCRIPT_PATH=%INSTALL_DIR%\scripts\time-sync.bat
45
set NSSM_PATH=%INSTALL_DIR%\nssm.exe
56
set OEM_DIR=C:\OEM
67

@@ -24,4 +25,7 @@ xcopy "%OEM_DIR%\*" "%INSTALL_DIR%\" /Y /E
2425
netsh advfirewall firewall add rule name="Allow WinBoat API 7148" dir=in action=allow protocol=TCP localport=7148
2526

2627
:: Start the service
27-
"%NSSM_PATH%" start WinBoatGuestServer
28+
"%NSSM_PATH%" start WinBoatGuestServer
29+
30+
:: Startup Tasks
31+
schtasks /create /tn "TimeSyncTask" /sc ONSTART /RL HIGHEST /tr "\"%TIME_SYNC_SCRIPT_PATH%\"" /RU SYSTEM

guest_server/scripts/time-sync.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
net stop w32time
3+
net start w32time
4+
w32tm /resync

0 commit comments

Comments
 (0)