Rewrite as Windows Wi-Fi monitor service

This commit is contained in:
2026-04-24 10:44:28 -04:00
parent 955e636d5f
commit 18cc9b6bab
15 changed files with 2190 additions and 539 deletions

17
winsw/README.md Normal file
View File

@@ -0,0 +1,17 @@
# WinSW
推荐先用 PyInstaller 生成 `dist\osu-wifi-login\osu-wifi-login.exe`,再把 WinSW 放进同一个发布目录。
1. 下载 WinSW x64 可执行文件,并重命名为 `osu-wifi-login-service.exe`
2. 将它放到 `dist\osu-wifi-login\`
3.`config.yaml` 放到 `dist\osu-wifi-login\`
4.`dist\osu-wifi-login\` 创建与 exe 同名的 `osu-wifi-login-service.xml`
5. 以管理员 PowerShell 运行:
```powershell
Set-Location .\dist\osu-wifi-login
.\osu-wifi-login-service.exe install
.\osu-wifi-login-service.exe start
```
如果你选择 `WiFi@OSU` 并启用随机 MAC服务账户需要有管理员权限否则无法写注册表并重启网卡。默认配置关闭随机 MAC。

17
winsw/osu-wifi-login.xml Normal file
View File

@@ -0,0 +1,17 @@
<service>
<id>osu-wifi-login</id>
<name>OSU Wi-Fi Login Service</name>
<description>Keeps WiFi@OSU or eduroam connected on Windows and logs into the captive portal when needed.</description>
<executable>%BASE%\osu-wifi-login.exe</executable>
<arguments>--config "%BASE%\config.yaml"</arguments>
<workingdirectory>%BASE%</workingdirectory>
<log mode="roll-by-size">
<sizeThreshold>1048576</sizeThreshold>
<keepFiles>8</keepFiles>
</log>
<onfailure action="restart" delay="10 sec" />
<stoptimeout>30 sec</stoptimeout>
</service>