# R0ice Community Reader -- one-command install (PowerShell). # Downloads the real Setup Wizard installer and runs it silently, so this # is just a thin trigger for the SAME install path the download-button page # uses -- not a second, separately-maintained install mechanism. (An # earlier hand-rolled zip-unpack script, get-and-run-v2.ps1, tried to # reimplement the installer's job by hand and never actually worked -- # census reported fine but the reading pipeline never started for at least # one real volunteer. That script is retired; this replaces it.) $ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # Cache-busting query param is REQUIRED, not cosmetic: this exe is served # with Cache-Control: max-age=14400 (4h). Confirmed live (2026-09-01) that a # volunteer who first downloaded before a fix landed kept getting served the # SAME stale cached copy on every later "fixed" re-run for hours -- the # script reported success and even the exe itself looked plausible, but it # was silently running old code the whole time. A cache-buster forces every # invocation of this script to actually fetch the current file. $cacheBust = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds() $manifestUrl = "https://r0ice.com/resource-team/version.json?v=$cacheBust" $setupPath = Join-Path $env:TEMP 'R0iceCommunityReader-Setup.exe' $manifest = Invoke-RestMethod -Uri $manifestUrl -UseBasicParsing if ($manifest.url -notmatch '^https://r0ice\.com/resource-team/R0iceCommunityReader-Setup(?:-\d+\.\d+\.\d+)?\.exe$') { throw 'The Reader release manifest has an unexpected installer URL.' } if ($manifest.sha256 -notmatch '^[0-9a-fA-F]{64}$') { throw 'The Reader release manifest has no valid SHA-256 checksum.' } $setupUrl = "$($manifest.url)?v=$cacheBust" # Kill any already-running copy BEFORE installing -- confirmed live # (2026-09-01/02) that a locked exe file (held open by a stale process from # a prior watchdog relaunch) can make the silent installer's file-copy step # fail invisibly: the script reports "Installing..." success, but the OLD # binary is still the one sitting on disk afterward, so a real fix can look # like it never landed no matter how many times it's rebuilt and redeployed. # This exact failure class (EPERM: operation not permitted, unlink) was hit # and confirmed on the dev machine the same night this was added. Get-Process -Name 'resource-team-native' -ErrorAction SilentlyContinue | Stop-Process -Force Start-Sleep -Milliseconds 500 # An existing Reader keeps its previous workload on automatic updates. A # deliberate re-run of this universal command opts that local install into # public caption and CPU physics jobs. Fresh installs opt in at first join. $readerConfig = Join-Path $env:LOCALAPPDATA 'R0iceResourceTeam\config.json' if ([version]$manifest.version -ge [version]'0.5.11' -and (Test-Path -LiteralPath $readerConfig)) { $readerSettings = Get-Content -LiteralPath $readerConfig -Raw -Encoding UTF8 | ConvertFrom-Json $readerSettings | Add-Member -NotePropertyName physics -NotePropertyValue $true -Force $readerSettings | Add-Member -NotePropertyName transcripts -NotePropertyValue $true -Force [IO.File]::WriteAllText($readerConfig, ($readerSettings | ConvertTo-Json -Depth 20), [Text.UTF8Encoding]::new($false)) } Write-Host '' Write-Host ' R0ice Community Reader -- joining the public research team.' -ForegroundColor Yellow if ([version]$manifest.version -ge [version]'0.5.11') { Write-Host ' This version helps with public books/prompts, public YouTube captions,' -ForegroundColor Cyan Write-Host ' and CPU particle-physics simulations. Pause or uninstall any time.' -ForegroundColor Cyan } Write-Host '' Write-Host ' Downloading (about 17 MB)...' $prevProgressPreference = $ProgressPreference $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $setupUrl -OutFile $setupPath -UseBasicParsing $ProgressPreference = $prevProgressPreference $actualSha = (Get-FileHash -LiteralPath $setupPath -Algorithm SHA256).Hash if ($actualSha -ne $manifest.sha256) { throw 'The installer does not match the public release manifest.' } Write-Host ' Installing...' Write-Host ' IMPORTANT: Windows may show a blue "Windows protected your PC" screen right' -ForegroundColor Yellow Write-Host ' now, possibly behind this window -- check your taskbar. If you see it, click' -ForegroundColor Yellow Write-Host ' "More info" then "Run anyway". This is Windows SmartScreen being cautious' -ForegroundColor Yellow Write-Host ' about a new small app, not a virus warning -- but it is NOT suppressed by' -ForegroundColor Yellow Write-Host ' running this silently, so it needs one real click from you if it appears.' -ForegroundColor Yellow Write-Host '' # /VERYSILENT: no installer wizard UI. /SUPPRESSMSGBOXES: no installer popups. # /NORESTART: never reboots. Everything the visible wizard does (scheduled # tasks, Start Menu entries, Add/Remove Programs registration) still happens. # NOTE: these flags only suppress the INSTALLER's own UI -- they do nothing # to Windows SmartScreen, which sits in front of any unsigned downloaded exe # at the OS level and can require a manual click before anything else runs. # A real volunteer install went silently missing for exactly this reason # (2026-09-01) -- the exe never appeared in Task Manager because SmartScreen # never let it start in the first place. $installer = Start-Process -FilePath $setupPath -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART' -Wait -PassThru if ($installer.ExitCode -ne 0) { throw "The installer exited with code $($installer.ExitCode)." } Remove-Item $setupPath -Force -ErrorAction SilentlyContinue Write-Host ' Checking that it actually started...' $ok = $false for ($i = 0; $i -lt 90; $i++) { try { $r = Invoke-WebRequest -Uri 'http://127.0.0.1:8477/state' -TimeoutSec 2 -UseBasicParsing if ($r.StatusCode -eq 200) { $ok = $true; break } } catch {} Start-Sleep -Seconds 1 } Write-Host '' if ($ok) { Write-Host ' Done! Opening the status page...' -ForegroundColor Green Write-Host ' (bookmark http://127.0.0.1:8477 -- that always shows what it''s doing, and has a pause button)' Write-Host '' Write-Host ' Want to stop for good? Settings -> Apps -> "R0ice Community Reader" -> Uninstall.' -ForegroundColor Cyan Start-Process 'http://127.0.0.1:8477' } else { Write-Host ' Hmm -- it does not look like it started yet.' -ForegroundColor Red Write-Host ' Most likely cause: a SmartScreen prompt is waiting for a click somewhere' -ForegroundColor Red Write-Host ' (check behind other windows / your taskbar) -- click "More info" then' -ForegroundColor Red Write-Host ' "Run anyway" if you find one, then wait a few seconds and check' -ForegroundColor Red Write-Host ' http://127.0.0.1:8477 yourself in a browser.' -ForegroundColor Red Write-Host '' Write-Host ' If there is no such prompt anywhere, Task Manager should show' -ForegroundColor Red Write-Host ' "resource-team-native.exe" running in the background -- if it truly is not' -ForegroundColor Red Write-Host ' there, tell R0ice exactly what you saw (or did not see) on screen.' -ForegroundColor Red }