How to run windows dependency program as linux executable or faking wsl path

Questions about Wine on Linux
Locked
brunoais
Level 2
Level 2
Posts: 11
Joined: Mon Mar 14, 2022 3:54 am

How to run windows dependency program as linux executable or faking wsl path

Post by brunoais »

I have a windows program (gitExtensions) whose main job is running git commands.

I'd like that program to execute git commands on the linux native git executable.
So, I'd like a path translation (can be done by me) and execute the linux native git command every time it's needed.

Actually, if I can fake my whole repository is running inside WSL, most of that translation work is already incorporated into gitExtensions. however, I don't see means to create a fake network drive which pretends to be a path to WSL's linux.

In other words:
  1. Is there a way to pretend my system's root is actually wsl?
  2. (otherwise) is there a way to launch an ELF directly in linux from a program running on wine?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: How to run windows dependency program as linux executable or faking wsl path

Post by jkfloris »

is there a way to launch an ELF directly in linux from a program running on wine?
From the WineHQ Wiki:

5.8 How do I launch native applications from a Windows application?
First, run regedit and add a dot character to the end of the list of extensions in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATHEXT.

You can then start native applications using wine cmd if you specify the full path or use the shell, e.g.:

Code: Select all

wine cmd /c /usr/bin/glxgears
brunoais
Level 2
Level 2
Posts: 11
Joined: Mon Mar 14, 2022 3:54 am

Re: How to run windows dependency program as linux executable or faking wsl path

Post by brunoais »

ARGH!!! I searched the FAQ with the wrong keywords -_-

663 is also useful to me :)

https://wiki.winehq.org/FAQ#How_do_I_as ... in_Wine.3F

Thank you
brunoais
Level 2
Level 2
Posts: 11
Joined: Mon Mar 14, 2022 3:54 am

Re: How to run windows dependency program as linux executable or faking wsl path

Post by brunoais »

Also, is there a way to fake a special location such as WSL in wine?
I kept searching for WSL keyword in the forums but I can't find what I am looking for.
For all I know, I can only emulate lettered drives but not network drives
brunoais
Level 2
Level 2
Posts: 11
Joined: Mon Mar 14, 2022 3:54 am

Re: How to run windows dependency program as linux executable or faking wsl path

Post by brunoais »

That way doesn't seem to be working with me.
doesntRecognizeWineAsAnExecutable.png
doesntRecognizeWineAsAnExecutable.png (13.54 KiB) Viewed 1608 times
And if I run with just cmd, there's no output. Actually. None of these work

Code: Select all

cmd /c /usr/bin/git --help
cmd /usr/bin/git --help
I did do the registry change as specified.
dotAtEndIsThere.png
What am I failing?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: How to run windows dependency program as linux executable or faking wsl path

Post by jkfloris »

In a Windows program you can find your Linux programs on the Z: disk.

For example:

Code: Select all

$ wine cmd
Microsoft Windows 6.1.7601

C:\>z:\usr\bin\git --help

C:\>usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]

These are common Git commands used in various situations:
...
brunoais
Level 2
Level 2
Posts: 11
Joined: Mon Mar 14, 2022 3:54 am

Re: How to run windows dependency program as linux executable or faking wsl path

Post by brunoais »

Oh! That was it works. I didn't notice the "wine cmd" part was only to start the wine environment in the command. I thought that also existed inside the windows environment.

It's working for me now, in wine. Now I'm having issues with other tools that work with wine, no longer a wine problem. Now I have a PlayOnLinux problem I will have to get help on in their forums.

Thank you.
Locked