Repository navigation
feat: a one-line installer for Windows - #34
Merged
Merged
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows gets the same one line macOS and Linux have:
scripts/install.ps1mirrorsinstall.sh: it finds the newest published release, downloads the x86_64 zip and its.sha256, checks the digest before anything is unpacked, runs the unpackeddeed.exe versionbefore copying it into%LOCALAPPDATA%\deed, and adds that folder to the user PATH only if it is not there.-Version,-Prefix,-Archiveand-Helpwork when it runs as a file, and$env:DEED_VERSION,$env:DEED_PREFIXand$env:DEED_ARCHIVEin 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.