# Research toolbox install (detached worker): node + download + setup_main $ErrorActionPreference = "Continue" $log = "C:\rtool_install.log" "START $(Get-Date)" | Out-File $log -Encoding UTF8 Remove-Item "C:\rtool_done.txt" -ErrorAction SilentlyContinue $choco = "$env:ProgramData\chocolatey\bin\choco.exe" "== install nodejs-lts ==" | Out-File $log -Append & $choco install -y --no-progress nodejs-lts *>> $log 2>&1 "== download rt files ==" | Out-File $log -Append $base = "https://scripts.cong.in/rt" foreach ($f in @("rt_setup_main.py","rt_views_v02.py","rt_backend_additions.py","rt_scaffold.py")) { try { (New-Object Net.WebClient).DownloadFile("$base/$f", "C:\Windows\Temp\$f") "ok $f" | Out-File $log -Append } catch { "ERR $f " + $_.Exception.Message | Out-File $log -Append } } $env:Path = [Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [Environment]::GetEnvironmentVariable("Path","User") + ";C:\Program Files\nodejs" "== run setup_main ==" | Out-File $log -Append $py = "C:\Python314\python.exe" if (-not (Test-Path $py)) { $py = (Get-Command python).Source } & $py "C:\Windows\Temp\rt_setup_main.py" *>> $log 2>&1 "SETUP_EXIT $LASTEXITCODE" | Out-File $log -Append "DONE $(Get-Date)" | Out-File $log -Append "DONE" | Out-File "C:\rtool_done.txt"