-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.cmd
More file actions
85 lines (76 loc) · 4.29 KB
/
Copy pathsetup.cmd
File metadata and controls
85 lines (76 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@echo off
rem ============================================================
rem TH108 Suite - one-time setup
rem Installs daemon dependencies, enables auto-start at login
rem (per-user, no admin), starts the daemon, opens the controller.
rem Requires: Node.js LTS (https://nodejs.org)
rem ============================================================
setlocal
cd /d "%~dp0"
where node >nul 2>nul
if errorlevel 1 (
echo [!] Node.js is required but was not found - it is a free, one-time install
echo ^(the daemon runs on it^). Opening the download page now...
start "" https://nodejs.org/en/download
echo Install the LTS, then double-click setup.cmd again.
pause
exit /b 1
)
echo [1/7] Installing daemon dependencies (no package install scripts are run)...
pushd th108-daemon
rem --ignore-scripts: npm normally lets every installed package run arbitrary code on YOUR machine at
rem install time. Two of the four here (node-hid, uiohook-napi) declare such a script. They do not need
rem it: both ship their compiled Windows binary inside the npm package itself (node_modules\<pkg>\prebuilds\)
rem and locate it themselves when the daemon loads them - the install script only exists to compile from
rem source when no prebuilt binary matches, which on Windows x64/arm64 never happens. Verified 2026-09-02:
rem `npm ci --ignore-scripts` + both modules load (node-hid enumerated devices, uiohook exposed start()).
rem So this flag removes install-time code execution at zero cost. It does NOT change that RUNNING the
rem daemon trusts these four packages' code - see the README's privacy section, which says so plainly.
call npm ci --ignore-scripts --no-audit --no-fund
if errorlevel 1 (
echo [!] npm ci failed - see the output above.
popd
pause
exit /b 1
)
popd
echo [2/7] Building the per-app audio capture helper (in-box .NET compiler, no SDK)...
set "CSC=%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\csc.exe"
if exist "%CSC%" (
"%CSC%" -nologo -optimize -out:"%~dp0th108-daemon\app-capture.exe" "%~dp0th108-daemon\app-capture.cs"
if errorlevel 1 (
echo [!] app-capture.exe build failed - "Specific app" audio source will be unavailable ^(the rest works^).
) else (
echo Built app-capture.exe ^(enables the "Specific app" music-layer source^).
)
) else (
echo [!] In-box C# compiler not found - skipping the per-app helper ^("Specific app" source unavailable^).
)
echo [3/7] Enabling auto-start at login (per-user logon task + Run key, no admin)...
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0th108-daemon\install-autostart.ps1"
echo [4/7] Adding the Start-menu shortcut (TH108 Lighting)...
powershell -NoProfile -Command "$ws = New-Object -ComObject WScript.Shell; $l = $ws.CreateShortcut([Environment]::GetFolderPath('Programs') + '\TH108 Lighting.lnk'); $l.TargetPath = 'wscript.exe'; $l.Arguments = '\"%~dp0th108-daemon\start-tray.vbs\"'; $l.Description = 'TH108 lighting tray + daemon'; $l.Save()" >nul
echo [5/7] Installing the recovery helper (ONE admin prompt - click No to skip)...
echo - Auto-Fix Lighting Wedge: hidden USB-restart recovery task
echo OPTIONAL - the suite works fine without it. (The same prompt also
echo removes the old WebHID pre-grant if an earlier install left one.)
powershell -NoProfile -Command "Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"%~dp0th108-daemon\install-admin-extras.ps1\"'" 2>nul
echo [6/7] Starting the tray (it starts and watches the daemon)...
wscript "%~dp0th108-daemon\start-tray.vbs"
echo [7/7] Opening the controller...
timeout /t 3 /nobreak >nul
start http://localhost:8123/
echo.
echo Done. Look for the salmon keyboard icon in your system tray - that is
echo the suite's home: it starts at login, watches the daemon, and reopens
echo the controller (double-click). Closed it? Start menu ^> TH108 Lighting.
echo.
echo One manual step remains: click "Connect Keyboard" and pick your
echo keyboard once per browser - the browser requires that click (WebHID).
echo The daemon keeps your lighting running even with the page closed.
echo.
echo Skipped the admin prompt and want the helper later? Run as admin:
echo powershell -ExecutionPolicy Bypass -File th108-daemon\install-admin-extras.ps1
echo.
echo To remove everything later, run uninstall.cmd (keeps your saved layers).
pause