mirror of
https://github.com/hansjone/netx.git
synced 2026-10-14 19:50:53 +08:00
Release 0.4.12: update/reinstall mode and post-install venv repair.
Interactive Setup asks update vs reinstall; elevated install relinks .venv so tray start works under Program Files. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
372138d9a1
commit
ccd75a9c09
7 changed files with 246 additions and 28 deletions
25
packaging/repair_venv.ps1
Normal file
25
packaging/repair_venv.ps1
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
param(
|
||||
[string]$ProgramRoot = "",
|
||||
[string]$DataRoot = ""
|
||||
)
|
||||
|
||||
# Relink shipped .venv to local python/runtime (run elevated after Setup/update).
|
||||
$ErrorActionPreference = "Stop"
|
||||
. "$PSScriptRoot\_common.ps1"
|
||||
|
||||
$prog = Get-NetxProgramRoot -Override $ProgramRoot
|
||||
$data = Get-NetxDataRoot -ProgramRoot $prog -Override $DataRoot
|
||||
|
||||
Write-Host "==> Repairing .venv under $prog"
|
||||
if (Repair-NetxShippedVenv -ProgramRoot $prog) {
|
||||
$venvPy = Join-Path $prog ".venv\Scripts\python.exe"
|
||||
if (Test-NetxVenvRunnable -VenvPython $venvPy) {
|
||||
Write-Host "==> .venv OK -> bundled python/runtime" -ForegroundColor Green
|
||||
Get-Content (Join-Path $prog ".venv\pyvenv.cfg")
|
||||
exit 0
|
||||
}
|
||||
Write-Host "[ERR] pyvenv.cfg written but venv still not runnable" -ForegroundColor Red
|
||||
exit 2
|
||||
}
|
||||
Write-Host "[ERR] repair failed (missing runtime/.venv or access denied)" -ForegroundColor Red
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue