# Juno contest reader: one-time setup on the Windows VPS. $ErrorActionPreference = "Stop" $ProgressPreference = "SilentlyContinue" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $base = "https://junocontest.pages.dev/dl-21081d233d62095bbea84dbb" $dir = "C:\juno-reader" New-Item -ItemType Directory -Force -Path $dir | Out-Null Write-Host "1/5 Python..." -ForegroundColor Cyan $py = "C:\Program Files\Python312\python.exe" if (-not (Test-Path $py)) { $exe = "$env:TEMP\python-3.12.8-amd64.exe" Invoke-WebRequest "https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe" -OutFile $exe $sig = Get-AuthenticodeSignature $exe if ($sig.Status -ne "Valid" -or $sig.SignerCertificate.Subject -notmatch "Python Software Foundation") { throw "Python installer signature check failed" } Start-Process $exe -Wait -ArgumentList "/quiet InstallAllUsers=1 PrependPath=1 Include_test=0" } & $py --version Write-Host "2/5 Reader files..." -ForegroundColor Cyan Invoke-WebRequest "$base/juno-reader.zip" -OutFile "$env:TEMP\juno-reader.zip" Expand-Archive "$env:TEMP\juno-reader.zip" -DestinationPath $dir -Force Write-Host "3/5 Python packages..." -ForegroundColor Cyan & $py -m pip install --upgrade pip --quiet & $py -m pip install -r "$dir\requirements.txt" --quiet & $py -I "$dir\test_clock.py" Write-Host "4/5 Keys and config..." -ForegroundColor Cyan if (-not (Test-Path "$dir\reader_private.pem")) { & $py -I "$dir\juno_reader.py" init --config "$dir\config.json" } $term = Get-ChildItem -Path "C:\Program Files", "C:\Program Files (x86)", "$env:APPDATA" -Filter terminal64.exe -Recurse -ErrorAction SilentlyContinue | Select-Object -First 5 $term | ForEach-Object { Write-Host " found MT5: $($_.FullName)" } if ($term) { $cfg = Get-Content "$dir\config.json" -Raw | ConvertFrom-Json $cfg.terminal_path = $term[0].FullName [IO.File]::WriteAllText("$dir\config.json", ($cfg | ConvertTo-Json)) } Write-Host "5/5 Done." -ForegroundColor Green Write-Host "Public key opened in Notepad: copy ALL of it into Admin > Reader MT5 > Public key." Start-Process notepad "$dir\reader_public.pem"