mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:43:17 +08:00
Chinese packaging scripts without BOM were misread as ANSI and failed at first-run. Document that bundled Python 3.13+ needs Server 2016+ / Win10+. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
825 B
PowerShell
25 lines
825 B
PowerShell
param(
|
|
[string]$ProgramRoot = "",
|
|
[switch]$Remove = $false
|
|
)
|
|
|
|
# Register / unregister NetX tray at current-user logon.
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
. "$PSScriptRoot\_common.ps1"
|
|
|
|
$prog = Get-NetxProgramRoot -Override $ProgramRoot
|
|
$tray = Join-Path $PSScriptRoot "netx_tray.ps1"
|
|
$runKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run"
|
|
$name = "NetX"
|
|
|
|
if ($Remove) {
|
|
Remove-ItemProperty -Path $runKey -Name $name -ErrorAction SilentlyContinue
|
|
Write-Host "==> Removed NetX from startup"
|
|
exit 0
|
|
}
|
|
|
|
$cmd = "powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$tray`" -ProgramRoot `"$prog`" -StartOnLaunch"
|
|
New-ItemProperty -Path $runKey -Name $name -Value $cmd -PropertyType String -Force | Out-Null
|
|
Write-Host "==> NetX tray will start at logon"
|
|
Write-Host " $cmd"
|