Skip to content

feat: a one-line installer for Windows - #34

Merged
sepehr-safari merged 2 commits into
mainfrom
one-line-install-on-windows
Oct 4, 2026
Merged

sepehr-safari merged 2 commits into
mainfrom
one-line-install-on-windows

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

Windows gets the same one line macOS and Linux have:

irm https://raw.githubusercontent.com/zig-nostr/deed/main/scripts/install.ps1 | iex

scripts/install.ps1 mirrors install.sh: it finds the newest published release, downloads the x86_64 zip and its .sha256, checks the digest before anything is unpacked, runs the unpacked deed.exe version before copying it into %LOCALAPPDATA%\deed, and adds that folder to the user PATH only if it is not there. -Version, -Prefix, -Archive and -Help work when it runs as a file, and $env:DEED_VERSION, $env:DEED_PREFIX and $env:DEED_ARCHIVE in the piped line. It is Windows PowerShell 5.1 compatible and pure ASCII, and the ASCII guard now covers it. On Windows on ARM it installs the x86_64 build, which Windows 11 runs under emulation.

A new CI job runs it on windows-latest under both pwsh and Windows PowerShell 5.1: a piped install, a file install run twice (the folder must appear in PATH once), a real key, event and verify with the installed binary, and a tamper test where a zip one byte off is refused and nothing is installed.

The README's install section is now the two one-liners and a short notes paragraph. The by-hand steps are gone.

`irm https://raw.githubusercontent.com/zig-nostr/deed/main/scripts/install.ps1 | iex` installs deed on Windows the way install.sh does on macOS and Linux. It finds the newest published release, downloads the Windows zip and the .sha256 beside it, and checks the digest before anything is unpacked: on a mismatch it installs nothing and says so. It runs the unpacked deed.exe before copying it anywhere, so a build that will not run never replaces a working copy, then puts it in %LOCALAPPDATA%\deed and adds that folder to the user PATH unless it is there already. ARM64 machines get the x86_64 build, which Windows 11 on ARM runs under emulation, since there is no ARM build for Windows.

The options match install.sh: -Version, -Prefix, -Archive and -Help when it runs as a file, and DEED_VERSION, DEED_PREFIX and DEED_ARCHIVE in the environment for a piped run, which has no command line. There is no top-level param() block, because Invoke-Expression would not treat one as parameters; the script is one script block called with the file's arguments, which also keeps its helpers out of the session a piped run executes in. A failed file run exits 1. A failed piped run raises an error instead of calling exit, which would close the terminal it runs in.

The PATH is read and written as the registry stores it, so the %VARIABLE% references already in it stay references. The script is pure ASCII, because Windows PowerShell 5.1 reads a file without a byte order mark in the legacy code page, and it keeps to 5.1 syntax with TLS 1.2 enabled where .NET does not offer it by default.

CI runs it on windows-latest under pwsh and under Windows PowerShell 5.1: once piped with its options in the environment, twice as a file to show an upgrade leaves one PATH entry, then a key, a signed event and a verify with the installed deed, and a tampered -Archive that must be refused with nothing installed. The ASCII check now covers install.ps1 too.
The Install section now opens with the two one-liners side by side: curl and bash for macOS and Linux, and `irm ... | iex` in PowerShell for Windows. The by-hand steps and the long PowerShell block are gone, since the installers do the same checks and the same PATH change. What is left is short: the options for both scripts, including the environment variables a piped Windows run reads, the x86_64 build on Windows on ARM, the unsigned Windows binary, the 1 GiB store on Windows, and the `~` in a --store path.

The skill and AGENTS.md point at the Windows installer the same way.
@sepehr-safari
sepehr-safari merged commit 4e37a1a into main Oct 4, 2026
5 checks passed
@sepehr-safari
sepehr-safari deleted the one-line-install-on-windows branch October 4, 2026 20:52
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