Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windows installation script #252

Merged
merged 2 commits into from
Sep 24, 2023

Conversation

Veetaha
Copy link
Contributor

@Veetaha Veetaha commented Sep 23, 2023

ChatGPT rules.However of course it made a ton of mistakes converting bash to powershell, and I of course I had to stare at powershell syntax with their poor error messages for some time. But, anyway, it's past that and the script works.

You can test it using a separate branch where I configured it to work with my fork.

curl.exe --location --silent --fail --show-error --retry 5 --retry-connrefused `
    https://raw.githubusercontent.com/Veetaha/marker/feat/install-on-windows-test/scripts/release/install.ps1 | powershell -command -

This was inspired by the installation script in deno. Turns out both curl.exe and tar.exe are available on windows by default, and deno also uses them for its installation script.

There are some stupid caveats with using unicode symbols (I'm not even saying ansi colors) on windows. I didn't look into that, and just made the script monochrome and use > character for logging the executed commands.


I didn't update the docs here. I think I'll just make separate PR for that whicj will also include the commit with the docs for linux


Also fixed the behavior of install.sh when the $CARGO_HOME variable is set. Previously it was writing directly to it, but instead it has to write to a $CARGO_HOME/bin subdirectory.

@Veetaha Veetaha force-pushed the feat/install-on-windows branch 5 times, most recently from 06db242 to 223e758 Compare September 23, 2023 18:00
@xFrednet xFrednet self-assigned this Sep 23, 2023
@xFrednet xFrednet added C-enhancement Category: New feature or request A-infra Area: Infrastructure and CI magic :sparkles: labels Sep 23, 2023
@Veetaha Veetaha force-pushed the feat/install-on-windows branch 2 times, most recently from ce74ada to 121b7fb Compare September 23, 2023 23:05
@Veetaha
Copy link
Contributor Author

Veetaha commented Sep 23, 2023

UPD
I just made the script work on linux too. It's possible to install powershell on linux. The only thing is that I had to add a condition that adds .exe to curl command on windows (due to a really stupid windows design decision described in code comment). So now it's possible to test the script on linux as well.

An important caveat is that you'll likely install the latest PowerShell 7.0 on linux, but on real Windows 10/11 the version of powershell is quite old (5.1), so don't try to use any new features.

@Veetaha Veetaha force-pushed the feat/install-on-windows branch 5 times, most recently from 6d2cae8 to f522649 Compare September 24, 2023 00:13
@Veetaha
Copy link
Contributor Author

Veetaha commented Sep 24, 2023

I'll just leave this here
PowerShell/PowerShell#3223 (comment)

Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I've tested it on a Windows computer, and it worked perfectly. Thank you for this!

Also, I have to say: I love the comments ^^ It makes reviewing the changes a lot more fun ❤️

scripts/release/install.ps1 Show resolved Hide resolved
@xFrednet xFrednet added this to the v0.3.0 milestone Sep 24, 2023
@xFrednet
Copy link
Member

Thank you!

@xFrednet xFrednet added this pull request to the merge queue Sep 24, 2023
Merged via the queue into rust-marker:master with commit 09396a2 Sep 24, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infra Area: Infrastructure and CI magic :sparkles: C-enhancement Category: New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants