Back to the main site

Run in Prefix From Command Line


#1

Is it possible to run an EXE with a Lutris WINE prefix from the command line like you can with the button in the ui?


#2
WINEPREFIX=/path/to/your/prefix wine /path/to/your/exe

or if you want to use one of the wine versions downloaded from lutris rather than your system wine, replace wine with the path to the lutris version, which should be something like ~/.local/share/lutris/runners/wine/wine-version-of-choice/bin/wine


#3

If you want wine to be the command to run (with custom WINEPREFIX), don’t prepend export to the command line. If you want the export to stick, add a linebreak before wine.

As for the OP’s question, there’s an option for running commandline shell in Winetricks.


#4

I am just directly interfacing the prefix with wine now, but it doesn’t provide a lot of what Lutris does like dxvk and esync. (The point isn’t to re do that all manually) I am working on a program that I want to have Lutris support where the user can have stuff configured however they want inside their prefix and my program just runs it how it would be in Lutris. What I’m thinking now is that I can edit the config file with my program to change the exe that is being run to what my program needs and just use the Lutris rungame command.


#5

…How is this related to the thread topic? Or had you just worded the topic confusingly, and what you wanted from the start wasn’t actually access to shell from wineprefix but something else (like a way to run a game installed in Lutris with a shell command, for example)?


#6

I wanted to use a command to do the same function as the “Run EXE inside wine prefix” button in Lutris for a given game. I did word it a bit weird.


#7

The simplest way to achieve that is probably to use the command included in desktop shortcuts exported from Lutris:
image
The ID here, if I’m not mistaken, is the number of local install (in order of installation, including those already removed).


#8

I agree that unique the numerical identifier is probably the best way to call it, but with that command I still can only run the game with whatever its exe is currently set to, so I would have to edit the config file to change the set executable. That would all be ok, but looking into it, I don’t see a way to %100 accurately connect a game with its local id to its config file, because multiple games can have the same config file name apart from a different numerical id that I don’t see a way of connecting with the other id.


#9

I don’t see any problem here… You just need to read data in the Lutris files, it’s all there.

On my system (and most likely on any other), information about game installs (including stuff like install ID, game slug, runner type, install path, and config ID) is located in an SQLite file ~/.local/share/lutris/pga.db; and all the install configs can be found in the folder ~/.config/lutris/games/.


#10

Thanks! I hadn’t noticed the database file. It looks like it has all the information I need. It’s not an ideal solution, but it should work.


#11

Oop, you’re right, I brain farted. Edited now.