Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.64k stars 36 forks source link

protontricks-launch with windows style path #279

Closed DanielGaaA closed 8 months ago

DanielGaaA commented 8 months ago

Is there way to run exe file with windows/wine style path? Wine allow to run application with windows style path https://wiki.winehq.org/Wine_User%27s_Guide#Using_wine_start

I want to use this to run Teamspeak 3 from Arma 3 proton prefix. Currently people are using would be much easier to run protontricks-launch --appid 107410 'C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe' instead of using full path protontricks-launch --appid 107410 '/home/deck/.steam/steam/steamapps/compatdata/107410/pfx/drive_c/Program Files/TeamSpeak 3 Client/ts3client_win64.exe'

To Reproduce Steps to reproduce the behavior:

  1. Run command protontricks-launch --appid 107410 'C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe'
  2. Command fails and error is displayed
    
    Traceback (most recent call last):
    File "/usr/bin/protontricks-launch", line 33, in <module>
    sys.exit(load_entry_point('protontricks==1.11.0', 'console_scripts', 'protontricks-launch')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/protontricks/cli/launch.py", line 18, in cli
    main(args)
    File "/usr/lib/python3.12/site-packages/protontricks/cli/util.py", line 159, in wrapper
    return cli_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/protontricks/cli/launch.py", line 111, in main
    executable_path = Path(args.executable).resolve(strict=True)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/pathlib.py", line 1240, in resolve
    s = self._flavour.realpath(self, strict=strict)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen posixpath>", line 435, in realpath
    File "<frozen posixpath>", line 470, in _joinrealpath
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Program Files\\TeamSpeak 3 Client\\ts3client_win64.exe'


**Additional context**

Currently we are using [ninelore script](https://github.com/ninelore/armaonlinux/blob/master/Arma3Helper.sh) that could be fully replaced by protontricks and with windows style path people will not need to figure out path to proton prefix. This make it much easier to just tell everyone run script without editing paths. 
Matoking commented 8 months ago

You can provide a custom command with -c. Combined with Wine's start parameter, something like this should work:

$ protontricks -c 'wine start "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe"' <appid>
DanielGaaA commented 8 months ago

Thank you this works. Sadly found out when protontrick is installed via flatpak, TS3 is not able to detect arma3 and interact with it (thanks sandbox)