rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

Update Windows installation documentation to recommend manual method

Open kennethd opened this issue 3 years ago • 5 comments

I am a linux user & do all of my development there, but started playing around with rust on a windows machine & just blindly followed the instructions at https://github.com/rust-lang/rustlings/#windows

This installation method requires installing with administrator privileges, installs into a protected system folder, which is read-only by default, and therefore, upon completion, rightly triggers errors from anti-virus software

Vim won't even cd to this protected directory

Upon realizing all of this, I undid it all by running cargo uninstall rustlings from the same administrator PowerShell session & manually deleting c:\\Windows\System32\rustlings, and did the manual installation steps as a regular user with no problem

There have been a couple past issues created by people who found themselves in trouble after following these instructions, e.g. https://github.com/rust-lang/rustlings/issues/878

kennethd avatar Oct 26 '22 00:10 kennethd

The install script installs into $pwd/rustlings by default. It seems like in your case, that was c://Windows/System32. Is that a Window default? I'd assumed a shell would not start in a directory like this, unless that's because the shell is in administrator mode? Apologies, I don't use Windows, so I can offer limited support here. I'd still like to have some sort of semi-automatic way of installing Rustlings on Windows, but maybe we can adjust things a bit.

manyinsects avatar Oct 26 '22 08:10 manyinsects

It looks like if you open PowerShell as Administrator the default $pwd is indeed C:\Windows\system32 -- something I perhaps should have noticed. If I do cd $HOME and mkdir tmp and cd tmp before running the Start-BitsTransfer line it does install there, but still installs it read-only & owned by the administrator account

Sorry that's not a lot of help, I probably know windows less than you, but do have a windows 10 laptop here I can test with :)

kennethd avatar Oct 28 '22 18:10 kennethd

Hey everyone! As kennethd stated the default directory when starting powershell as admin is C:\Windows\system32. Maybe it would be better if at line 4 of install.ps1 instead of $pwd we use $home, as the later will refer to C:\Users\MyUser

As follows: param($path = "$home/rustlings")

MarcosDanielTorres avatar Jan 01 '23 15:01 MarcosDanielTorres

It just installed Rustlings in my System32 folder too. The intructions need to mention that you need to navigate to the desired folder first or the script needs to act more intelligently. Current situation is not very user friendly and will mean a broken installation for most users on the first try.

Illiou avatar Jun 14 '23 21:06 Illiou

Updated the script to install in $home/rustlings for now, until we find a better solution.

manyinsects avatar Jun 15 '23 08:06 manyinsects

This issue will be prevented by https://github.com/rust-lang/rustlings/issues/1919

mo8it avatar Mar 30 '24 16:03 mo8it