Ship Windows plug-and-play host exe with USB wait and autostart.

Users no longer need Python: run.bat or install_autostart.ps1; agent reconnects when CYD is plugged in.
This commit is contained in:
2026-10-27 20:23:57 +08:00
parent 8cc030178f
commit f83df3fd39
8 changed files with 257 additions and 66 deletions

View File

@@ -0,0 +1,15 @@
$ErrorActionPreference = "Stop"
$startup = [Environment]::GetFolderPath("Startup")
$lnkPath = Join-Path $startup "CYD-ServerInfo.lnk"
if (Test-Path $lnkPath) {
Remove-Item $lnkPath -Force
Write-Host "Removed: $lnkPath"
} else {
Write-Host "No Startup shortcut found."
}
Get-CimInstance Win32_Process -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match 'send_sysinfo' -or ($_.CommandLine -and $_.CommandLine -match 'send_sysinfo') } |
ForEach-Object {
Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue
Write-Host "Stopped PID $($_.ProcessId)"
}