Closed brianly closed 4 years ago
It looks like it is possible to detect that you are running under Bash on Windows. This behaviour has been seen as a problem by others, and there is a registry setting to stop WSL combining Windows and Linux paths.
Would this project accept an update to install.sh that detected WSL and offered only Linux paths? My personal feeling is that end user software should try to be low friction for end users. Lektor was low friction on macOS, but not Windows for me.
@brianly I've just found out, after banging my head against the wall a few times (not really), that there are 2 versions to that:
If you've installed WSL the lxrun
way:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss]
"AppendNtPath"=dword:00000000
If you've installed WSL from the Windows Store (like I did):
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager]
"DistributionFlags"=dword:fffffffd
I've found them both courtesy of @benhillis Just wanted to mention both, in case anyone reaches this and the first way doesn't work for them if they've installed WSL from the Store.
Would this project accept an update to install.sh that detected WSL and offered only Linux paths? My personal feeling is that end user software should try to be low friction for end users. Lektor was low friction on macOS, but not Windows for me.
@brianly I know this issues is a bit old, but for the record, I agree that we want installs to be as low friction as possible, and updates to the install.ps1 and install.sh files to that effect are great. I don't personally have Windows, or Windows experience that's at all recent though, so I'm labeling this as 'help wanted'.
@brianly / @MrCroft if you are still watching this, what would be a good location to install under in this setup?
The installer finds the first writable directory in $PATH
(trying these first https://github.com/lektor/lektor-website/blob/1a059fa7007d92860b015bbdfb452bb0ceadcff4/assets/installer.py#L36 and avoiding anything '/sbin').
My personal feeling is that end user software should try to be low friction for end users. Lektor was low friction on macOS, but not Windows for me.
If you have a predictable $HOME
that should make things low-friction. That old find_user_paths()
call you posted ends up being reordered according to POSIX_BIN_DIRS
.
Using native windows python should also be low-friction.
Would this project accept an update to install.sh that detected WSL and offered only Linux paths?
@brianly if you still wanna fix this, the secret is in posix_find_bin_dir()
in the code I linked. Ideally only a small tweak to POSIX_BIN_DIRS
would do it, but also check the result of posix_find_lib_dir()
.
Closing this for lack of feedback. It's also been a long time since the report and the installer has been overhauled. If it's still an issue please reopen.
I wanted to install on Windows 10. Thinking that ImageMagick might be a pain to install I tried installation under WSL. When I do this I find that install.sh resolves some odd installation directories:
I have Go installed under Windows and it seems to want to install there. If I look at my $PATH variable under WSL it looks like it includes values from Linux and Windows:
Running the find_user_paths() function independently under WSL I get:
I haven't done enough research to understand the expected behaviour with paths, but I see similar behavior on another computer running WSL under Windows 10.