Update windows install docs

This commit is contained in:
Anmol Sethi 2022-12-07 19:42:58 -08:00
parent 3134648273
commit 44c11a13ce
No known key found for this signature in database
GPG key ID: 25BC68888A99A8BA
2 changed files with 22 additions and 18 deletions

View file

@ -19,23 +19,27 @@ ensure_os
if [ "$OS" = windows ]; then
cat <<EOF
We currently do not have a .msi for automatic installation on Windows so this release is
structured the same as our Unix releases.
We currently do not have an \`.msi\` for automatic installation on Windows so this release
is structured the same as our Unix releases.
Easiest way to use d2 on Windows is to just cd into the bin directory of this release
and invoke d2 like \`./d2.exe <full-input-file-path>\`
Easiest way to use d2 on Windows is to just \`chdir\` into the bin directory of this release
and invoke d2 like \`./d2 <full-input-file-path>\`
You can install on Windows with [MSYS2](https://www.msys2.org/) which emulates a Linux
shell for Windows. It also enables d2 to show colors in its output.
For installation you'll have to add the \`./bin/d2.exe\` binary to your \`\$PATH\`. Or add
the \`./bin\` directory of this release to your \`\$PATH\`.
But if you must install on Windows without MSYS2, for now you'll have to add the d2 binary
in \`./bin/d2.exe\` to your \`\$PATH\` manually. Or you can add the \`./bin\` directory to
your \`\$PATH\`.
See https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows
Then you'll be able to call \`d2\` from the commandline in \`cmd.exe\` or \`pwsh.exe\`.
We intend to have a \`.msi\` release installer sometime soon that handles putting \`d2\` into
your \`\$PATH\` for you.
See https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows
You can also use \`make install\` to install on Windows after first installing
[MSYS2](https://www.msys2.org/) which emulates a Linux shell for Windows. Its terminal
also enables d2 to show colors in its output. The manpage will also become accessible
with \`man d2\`.
See https://github.com/terrastruct/d2/blob/master/docs/INSTALL.md#windows
EOF
fi

View file

@ -140,7 +140,7 @@ go install oss.terrastruct.com/d2@latest
### Source Release
To install a proper release from source clone the repository and then:
To install a release from source clone the repository and then:
```sh
./ci/release/build.sh --install
@ -149,9 +149,9 @@ To install a proper release from source clone the repository and then:
```
Installing a real release will also install manpages and in the future other assets like
fonts and icons. Furthermore, when installing a non versioned commit, installing a proper
release will ensure that `d2 --version` works correctly by embedding the commit hash into
the `d2` binary.
fonts and icons. Furthermore, when installing a non versioned commit, installing a release
will ensure that `d2 --version` works correctly by embedding the commit hash into the `d2`
binary.
## Windows
@ -160,10 +160,10 @@ d2 builds and runs on Windows:
We have prebuilt standalone releases for Windows though they're structured in the same way
as our Unix releases.
Easiest way to use d2 on Windows is to just cd into the bin directory of the release after
extracting it and invoking d2 like `./d2.exe <full-input-file-path>`
Easiest way to use d2 on Windows is to just `chdir` into the bin directory of the release
and invoke d2 like `./d2 <full-input-file-path>`
For installation, you'll have to manually put the d2 binary into your `$PATH` or add the
For installation, you'll have to put the `bin/d2.exe` binary into your `$PATH` or add the
`bin` directory of the release into your `$PATH`.
See https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows
@ -182,7 +182,7 @@ Bash](https://gitforwindows.org/#bash) (Git Bash is based on MSYS2) for an impro
terminal experience.
MSYS2 provides a unix style shell environment that is native to Windows (unlike
[Cygwin](https://www.cygwin.com/)). MSYS2 allows `install.sh` to work, enables proper
[Cygwin](https://www.cygwin.com/)). MSYS2 allows `install.sh` to work, enables automatic
installation of our standalone releases via `make install` and makes the manpage
accessible via `man d2`.