cpbotha / xdg-open-wsl

xdg-open replacement for WSL that opens files and links using Windows apps.
BSD 3-Clause "New" or "Revised" License
159 stars 12 forks source link

Use Wine start.exe #7

Open b- opened 2 years ago

b- commented 2 years ago

(This probably should be a branch at best, unless this turns out to be the ideal way to do it...)

Wine ships a start.exe file that implements cmd.exe /c start (via ShellExecuteEx()) and is compatible with Windows. We can use this to ShellExecuteEx() files and URLs from the command line.

It's not super smart with regards to WSL paths, but the functions meant for cmd.exe in the xdg-open-wsl Python script work just fine so far. This is far faster to launch than PowerShell and far more compatible than cmd.exe, and on top of that it launches I'm not 150% certain on the licensing requirements, but it seems that as long as we include the LGPL2 license agreement and links to the source code as compiled, it should be fine. I'm thinking of just making another GitHub repository to mirror the files as they are included in this pull request, because I don't want to assume winehq.org will keep this specific package version up.

b- commented 2 years ago

Fixes https://github.com/cpbotha/xdg-open-wsl/issues/6