Skip to content

feat(install): one-line PowerShell install (install.ps1) - #253

Merged
its-janghoon merged 3 commits into
developfrom
feat/installps1
Nov 13, 2026
Merged

its-janghoon merged 3 commits into
developfrom
feat/installps1

Conversation

@its-janghoon

Copy link
Copy Markdown
Member

What's done

  • install.ps1 at the repo root: irm https://raw.githubusercontent.com/redrob-labs/redrob-code/main/install.ps1 | iex, or & ([scriptblock]::Create((irm <url>))) -Version x.y.z. It follows install: picks redrob-windows-x64.zip, -x64-baseline.zip (no AVX2) or -arm64.zip, takes the latest version from releases/latest/download/VERSION or -Version / REDROB_VERSION, checks the zip against the release's SHA256SUMS.txt, and installs redrob.exe + redrob-code.exe into %USERPROFILE%\.redrob\bin. That is where Redrob Desktop (enginesetup.rs) and isCurlInstall look. It puts the folder first on the user PATH (HKCU only, kept as REG_EXPAND_SZ) and in the current session, and prints the next step (redrob, then /connect) in English and Korean. Options: -InstallDir/REDROB_INSTALL_DIR, -NoModifyPath/REDROB_NO_MODIFY_PATH=1, -Binary/REDROB_CODE_BIN, -Connect/REDROB_CONNECT. It also reads install.sh's REDROB_CODE_* names.
  • redrob upgrade on a Windows curl install (~\.redrob\bin) now downloads install.ps1 and runs it with powershell.exe -File (the file starts with a UTF-8 BOM). Before this, it piped Console's install.sh into bash/sh. Windows usually has neither, and install.sh refuses to run on Windows anyway. A running redrob.exe is renamed to .old and the new one is copied in.
  • The unknown-method message suggests the irm ... | iex line on Windows.
  • README.md / README.ko.md: a Windows install section.
  • Tests: test/installation/install-ps1.test.ts checks that the script has no param block and no exit, is ASCII only, uses the right install dir, env names, asset names and checksum file, and writes HKCU only. When pwsh is installed it also checks that the script parses. installation.test.ts checks the Windows upgrade path.

What's not done

  • I did not change Console's /code/install.ps1 (redrob-console). It fails under Windows PowerShell 5.1 with -NonInteractive: Invoke-WebRequest without -UseBasicParsing cannot read SHA256SUMS.txt, so it says "No checksums published" and installs nothing (reproduced on a Windows 11 PC). That is why upgrade uses this repo's script.
  • I added no new CI job. The parse test runs only where pwsh exists.
  • The bash install script still does not verify checksums (unchanged).

What to review

  • install.ps1: the whole script is one & { ... } @args block, so iex leaves no variables behind. Errors throw instead of calling exit, which would close the user's window.
  • packages/redrob/src/installation/index.ts: upgradeScriptUrl / reinstallCommand and the win32 branch of upgradeCurl.

Intentions

Windows users get the same one-line install as macOS/Linux users, without bash or admin rights, into the folder Desktop and redrob upgrade already use.

Verification

  • Linux: bun typecheck passed. bun test test/installation: 31 pass, 1 skip (pwsh parse), 0 fail. Full packages/redrob suite: 3573 pass, 2 fail. Both failures (event-manifest, transform-wire-body) also fail on origin/develop 7aabeeb.
  • Windows 11 PC, Windows PowerShell 5.1.26100, every install into a temp folder:
    • irm <branch raw url> | iex installed 0.18.16 and redrob --version printed 0.18.16. The folder went first on the user PATH, and redrob resolved to it in the same session. Running it again printed "already installed".
    • PowerShell 7.7.0 (portable): the scriptblock form -Version 0.18.15 -InstallDir ... -NoModifyPath printed 0.18.15. -Version 9.9.9 threw a clear error, the session stayed open and nothing was installed.
    • powershell -File with the env vars installed and printed the Korean line correctly, so the ASCII + base64 approach works.
    • The upgrade command the engine runs (BOM + -NonInteractive -File, REDROB_CODE_VERSION/REDROB_CODE_INSTALL_DIR) upgraded 0.18.15 to 0.18.16 while that redrob.exe serve was running.
    • The user PATH was restored byte for byte, and the temp folders were removed.

irm https://raw.githubusercontent.com/redrob-labs/redrob-code/main/install.ps1 | iex installs redrob.exe into %USERPROFILE%\.redrob\bin, verified against the release's SHA256SUMS.txt. redrob upgrade on a Windows curl install now re-runs Console's install.ps1 through PowerShell instead of piping install.sh into a bash that Windows does not have.
Console's /code/install.ps1 calls Invoke-WebRequest without -UseBasicParsing, so under Windows PowerShell 5.1 with -NonInteractive it cannot read SHA256SUMS.txt and refuses every upgrade.
@its-janghoon

Copy link
Copy Markdown
Member Author

Self-review: The riskiest part is the iex contract. install.ps1 has no param block and never calls exit, and test/installation/install-ps1.test.ts guards both, because a stray exit closes the user's PowerShell window. The script is ASCII only, with the Korean line stored as base64 UTF-8, so Windows PowerShell 5.1 reads it the same in any code page. I checked that on a cp949 PC with -File. PATH edits go only to HKCU\Environment and keep REG_EXPAND_SZ. I restored the PC's PATH byte for byte after testing. The upgrade change only affects win32 'curl' installs, which could never upgrade before because they piped install.sh into a bash that is missing. Linux and macOS still use Console's install.sh unchanged. One follow-up belongs outside this repo: Console's /code/install.ps1 needs -UseBasicParsing on its Invoke-WebRequest calls, otherwise it cannot verify checksums under PS 5.1 -NonInteractive.

@its-janghoon
its-janghoon merged commit eb241ad into develop Nov 13, 2026
12 checks passed
@its-janghoon
its-janghoon deleted the feat/installps1 branch November 13, 2026 05:58
@its-janghoon its-janghoon mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant