andy-5 / wslgit

Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)
MIT License
1.18k stars 59 forks source link

Can't run install.bat #117

Closed HassanSiddique closed 2 years ago

HassanSiddique commented 3 years ago

When I tried to run install.bat it throws this error...

Make sure Fork.RI is executable in WSL...
ERROR! Failed to make Fork.RI executable in WSL.
$ ls -al  /c/Program\ Files/wslgit/cmd/
total 1400
dr-xr-xr-x 1 hassansiddique hassansiddique     512 Jun 28 23:19 .
dr-xr-xr-x 1 hassansiddique hassansiddique     512 Jun 28 23:19 ..
-rwxrwxrwx 1 hassansiddique hassansiddique    1411 Jun 28 23:19 Fork.RI
-r-xr--r-- 1 hassansiddique hassansiddique 1428480 Jun 28 23:19 wslgit.exe

I'm using Pengwin (Debian) on WSL2.

carlolars commented 3 years ago

Have you mounted with "metadata" in your options in /etc/wsl.conf? I see that you have put wslgit in C:\Program Files, I don't think it should be a problem but I've always put it in my local appdata, C:\Users\username\AppData\Local\wslgit, and it has always worked for me.

HassanSiddique commented 3 years ago

Thank you @carlolars for your help. I'm actually using your guide @ https://gist.github.com/carlolars/7914d2606204001e798c812961c3ac88. I thought that perhaps the problem was root = / setting the permissions to644 but I addressed that by chmod +x /.../fork.exe, but no cigar.

Anyways, my setting are exactly as you indicated in your guide; including metadata.

HassanSiddique commented 3 years ago

FWIW my colleague was successfully able to set his up using your guide, but he doesn't use Fork as his primary client. He uses Tower and has the whole thing set up with cross-platform GPG and SSH signing and everything. That's kinda what I want to achieve with mine, however, he didn't run into this problem with his; however, his is installed into C:\Program Files\wslgit and works without any known issues.

peterlobster commented 3 years ago

@carlolars @HassanSiddique I think I'm having the same problem. Any fix? I've tried to force wsl -- chmod +x Fork.RI which succeeded but still nothing.

forszpanen commented 3 years ago

Yesterday I did some test. On my computer it works - Windows 10 Pro 20H2 19042.1052. I use wslgit for gitextension mainly. My colleague encountered that same problem as described. We tried one workaround but a main cause still is not known. We opened WSL2 ubuntu 20.04 in terminal and we go to the place where wslgit is on windows. e.g. /mnt/c/tools/wslgit next in terminal: chmod +x Fork.RI and next in install.bat we commented the part: echo Make sure Fork.RI is executable in WSL... wsl -- chmod +x cmd/Fork.RI if %ERRORLEVEL% neq 0 ( echo ERROR! Failed to make Fork.RI executable in WSL. goto :error ) echo OK.

We installed git for windows and we put to PATH: C:\Program Files\Git\cmd After those steps wslgit started working wit gitextension. example path to repo: \wsl$\Ubuntu-20.04\home\filip\projects

spaceemotion commented 2 years ago

In my case the default WSL was set to "docker-desktop-data" (probably because I installed Docker before Ubuntu).

  1. See which Distro is your default: wsl --list
  2. Set your Ubuntu/CentOS/... as default: e.g. wsl --setdefault Ubuntu-20.04
  3. Retry the install.bat
carlolars commented 2 years ago

@carlolars @HassanSiddique I think I'm having the same problem. Any fix? I've tried to force wsl -- chmod +x Fork.RI which succeeded but still nothing.

I've done some testing of my own but I haven't been able to reproduce :/ The chmod always works for me.
I think the proper fix is to just remove the chmod from the installation script and those who use Fork will just have to chmod manually, you actually get a very clear error message if Fork.RI is not allowed to execute:

fatal: cannot exec '/c/Users/carlolars/AppData/Local/wslgit/bin/Fork.RI': Permission denied
error: unable to start editor '/c/Users/carlolars/AppData/Local/wslgit/bin/Fork.RI'
Grkmus commented 2 years ago

I had the same problem, somehow the the Fork.RI were not being executable even though I set it with chmod +x Fork.RI manually. So, I check the install.bat script in the text file and find out that it is also trying to grant access to the Fork.RI file within the script and fail at that point. So, I commented out that part (as I already made the Fork.RI executable manually) and it worked.

Grkmus commented 2 years ago

one update; I am having problems to Fetching a repo after I set the generated git.exe file in the Fork git client.

Grkmus commented 2 years ago

Another update; after defining my github account through File -> Accounts with my Github personel token the fetch problem seem to be solved too.

andy-5 commented 2 years ago

This should now be fixed in release v1.1.0.