mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
Add update checker, tray controller, and slimmer release venv.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
54c6bc9298
commit
fe9df32024
7 changed files with 367 additions and 13 deletions
25
packaging/install_autostart.ps1
Normal file
25
packaging/install_autostart.ps1
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue