Deprecate usage of $WINESTEAM locations

This commit is contained in:
Mathieu Comandon 2021-07-19 14:55:14 -07:00
parent 78a094d0ce
commit c86eee1ac2
6 changed files with 35 additions and 55 deletions

View file

@ -190,7 +190,7 @@ Example: ``main_file: game.rom``.
Can also be used to pass the URL for web based games: ``main_file: http://www...`` Can also be used to pass the URL for web based games: ``main_file: http://www...``
``args``: Pass additional arguments to the command. ``args``: Pass additional arguments to the command.
Can be used with linux, wine, winesteam, dosbox, scummvm, pico8 and zdoom runners. Can be used with linux, wine, dosbox, scummvm, pico8 and zdoom runners.
Example: ``args: -c $GAMEDIR/exult.cfg`` Example: ``args: -c $GAMEDIR/exult.cfg``
``working_dir``: Set the working directory for the game executable. ``working_dir``: Set the working directory for the game executable.
@ -199,21 +199,18 @@ the executable resides in.
This directive can be used for Linux, Wine and Dosbox installers. This directive can be used for Linux, Wine and Dosbox installers.
Example: ``$GAMEDIR/path/to/game`` Example: ``$GAMEDIR/path/to/game``
Wine and other wine based runners like WineSteam Wine and other wine based runners
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``arch``: Sets the architecture of a Wine prefix. By default it is set to ``win64``, ``arch``: Sets the architecture of a Wine prefix. By default it is set to ``win64``,
the value can be set to ``win32`` to setup the game in a 32-bit prefix. the value can be set to ``win32`` to setup the game in a 32-bit prefix.
``prefix``: Path to the Wine prefix. For Wine games, it should be set to ``prefix``: Path to the Wine prefix. For Wine games, it should be set to
``$GAMEDIR``. For WineSteam games, set it to ``$GAMEDIR/prefix`` to isolate the ``$GAMEDIR``.
prefix files from the game files. This is only needed if the Steam game
needs customization. If not provided, Lutris will use WineSteam's default prefix
where Steam for Windows is installed.
DRM free Steam and WineSteam DRM free Steam
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
Lutris has the ability to run Steam games without launching the Steam client. Lutris has the ability to run Steam games without launching the Steam client.
This is only possible with certain games lacking the Steam DRM. This is only possible with certain games lacking the Steam DRM.
@ -368,8 +365,8 @@ Examples::
referer: www.mywebsite.com referer: www.mywebsite.com
If the game makes use of (Windows) Steam data, the value should be If the game makes use of Steam data, the value should be
``$WINESTEAM:appid:path/to/data``. This will check that the data is available ``$STEAM:appid:path/to/data``. This will check that the data is available
or install it otherwise. or install it otherwise.
@ -602,8 +599,8 @@ with ``wine.wineexec`` as the task's ``name``)
Currently, the following tasks are implemented: Currently, the following tasks are implemented:
* wine / winesteam: ``create_prefix`` Creates an empty Wine prefix at the * wine: ``create_prefix`` Creates an empty Wine prefix at the
specified path. The other wine/winesteam directives below include the specified path. The other wine directives below include the
creation of the prefix, so in most cases you won't need to use the creation of the prefix, so in most cases you won't need to use the
create_prefix command. Parameters are: create_prefix command. Parameters are:
@ -626,7 +623,7 @@ Currently, the following tasks are implemented:
name: create_prefix name: create_prefix
arch: win64 arch: win64
* wine / winesteam: ``wineexec`` Runs a windows executable. Parameters are * wine: ``wineexec`` Runs a windows executable. Parameters are
``executable`` (``file ID`` or path), ``args`` (optional arguments passed ``executable`` (``file ID`` or path), ``args`` (optional arguments passed
to the executable), ``prefix`` (optional WINEPREFIX), to the executable), ``prefix`` (optional WINEPREFIX),
``arch`` (optional WINEARCH, required when you created win64 prefix), ``blocking`` (if true, do not run the process in a thread), ``working_dir`` (optional working directory), ``include_processes`` (optional space-separated list of processes to include to ``arch`` (optional WINEARCH, required when you created win64 prefix), ``blocking`` (if true, do not run the process in a thread), ``working_dir`` (optional working directory), ``include_processes`` (optional space-separated list of processes to include to
@ -641,7 +638,7 @@ Currently, the following tasks are implemented:
executable: drive_c/Program Files/Game/Game.exe executable: drive_c/Program Files/Game/Game.exe
args: --windowed args: --windowed
* wine / winesteam: ``winetricks`` Runs winetricks with the ``app`` argument. * wine: ``winetricks`` Runs winetricks with the ``app`` argument.
``prefix`` is an optional WINEPREFIX path. You can run many tricks at once by adding more to the ``app`` parameter (space-separated). ``prefix`` is an optional WINEPREFIX path. You can run many tricks at once by adding more to the ``app`` parameter (space-separated).
By default Winetricks will run in silent mode but that can cause issues By default Winetricks will run in silent mode but that can cause issues
@ -656,7 +653,7 @@ Currently, the following tasks are implemented:
For a full list of available ``winetricks`` see here: https://github.com/Winetricks/winetricks/tree/master/files/verbs For a full list of available ``winetricks`` see here: https://github.com/Winetricks/winetricks/tree/master/files/verbs
* wine / winesteam: ``eject_disk`` runs eject_disk in your ``prefix`` argument. Parameters are * wine: ``eject_disk`` runs eject_disk in your ``prefix`` argument. Parameters are
``prefix`` (optional wineprefix path). ``prefix`` (optional wineprefix path).
Example: Example:
@ -666,7 +663,7 @@ Currently, the following tasks are implemented:
- task: - task:
name: eject_disc name: eject_disc
* wine / winesteam: ``set_regedit`` Modifies the Windows registry. Parameters * wine: ``set_regedit`` Modifies the Windows registry. Parameters
are ``path`` (the registry path, use backslashes), ``key``, ``value``, are ``path`` (the registry path, use backslashes), ``key``, ``value``,
``type`` (optional value type, default is REG_SZ (string)), ``prefix`` ``type`` (optional value type, default is REG_SZ (string)), ``prefix``
(optional WINEPREFIX), ``arch`` (optional WINEPREFIX), ``arch``
@ -683,7 +680,7 @@ Currently, the following tasks are implemented:
value: '00000000' value: '00000000'
type: REG_DWORD type: REG_DWORD
* wine / winesteam: ``delete_registry_key`` Deletes registry key in the Windows registry. Parameters * wine: ``delete_registry_key`` Deletes registry key in the Windows registry. Parameters
are ``key``, ``prefix`` are ``key``, ``prefix``
(optional WINEPREFIX), ``arch`` (optional architecture of the prefix, required when you created win64 prefix). (optional WINEPREFIX), ``arch`` (optional architecture of the prefix, required when you created win64 prefix).
@ -698,7 +695,7 @@ Currently, the following tasks are implemented:
value: '00000000' value: '00000000'
type: REG_DWORD type: REG_DWORD
* wine / winesteam: ``set_regedit_file`` Apply a regedit file to the * wine: ``set_regedit_file`` Apply a regedit file to the
registry, Parameters are ``filename`` (regfile name), registry, Parameters are ``filename`` (regfile name),
``arch`` (optional architecture of the prefix, required when you created win64 prefix). ``arch`` (optional architecture of the prefix, required when you created win64 prefix).
@ -709,7 +706,7 @@ Currently, the following tasks are implemented:
name: set_regedit_file name: set_regedit_file
filename: myregfile filename: myregfile
* wine / winesteam: ``winekill`` Stops processes running in Wine prefix. Parameters * wine: ``winekill`` Stops processes running in Wine prefix. Parameters
are ``prefix`` (optional WINEPREFIX), are ``prefix`` (optional WINEPREFIX),
``arch`` (optional architecture of the prefix, required when you created win64 prefix). ``arch`` (optional architecture of the prefix, required when you created win64 prefix).

View file

@ -1,16 +1,13 @@
"""Dialog used to install versions of a runner""" """Dialog used to install versions of a runner"""
import gettext
# Standard Library
# pylint: disable=no-member # pylint: disable=no-member
import gettext
import os import os
import random import random
from collections import defaultdict from collections import defaultdict
from gettext import gettext as _ from gettext import gettext as _
# Third Party Libraries
from gi.repository import GLib, Gtk from gi.repository import GLib, Gtk
# Lutris Modules
from lutris import api, settings from lutris import api, settings
from lutris.database.games import get_games_by_runner from lutris.database.games import get_games_by_runner
from lutris.game import Game from lutris.game import Game
@ -242,8 +239,6 @@ class RunnerInstallDialog(Dialog):
def get_usage_stats(self): def get_usage_stats(self):
"""Return the usage for each version""" """Return the usage for each version"""
runner_games = get_games_by_runner(self.runner) runner_games = get_games_by_runner(self.runner)
if self.runner == "wine":
runner_games += get_games_by_runner("winesteam")
version_usage = defaultdict(list) version_usage = defaultdict(list)
for db_game in runner_games: for db_game in runner_games:
if not db_game["installed"]: if not db_game["installed"]:

View file

@ -86,15 +86,14 @@ class InstallerFileBox(Gtk.VBox):
if self.provider == "steam": if self.provider == "steam":
steam_installer = SteamInstaller(self.installer_file.url, steam_installer = SteamInstaller(self.installer_file.url,
self.installer_file.id) self.installer_file.id)
steam_installer.connect("game-installed", self.on_download_complete) steam_installer.connect("steam-game-installed", self.on_download_complete)
steam_installer.connect("state-changed", self.on_state_changed) steam_installer.connect("steam-state-changed", self.on_state_changed)
self.start_func = steam_installer.install_steam_game self.start_func = steam_installer.install_steam_game
self.stop_func = steam_installer.stop_func self.stop_func = steam_installer.stop_func
steam_box = Gtk.HBox(spacing=6) steam_box = Gtk.HBox(spacing=6)
info_box = Gtk.VBox(spacing=6) info_box = Gtk.VBox(spacing=6)
steam_label = InstallerLabel(_("Steam game for {platform} (appid: <b>{appid}</b>)").format( steam_label = InstallerLabel(_("Steam game <b>{appid}</b>").format(
platform=steam_installer.platform,
appid=steam_installer.appid appid=steam_installer.appid
)) ))
info_box.add(steam_label) info_box.add(steam_label)
@ -277,6 +276,7 @@ class InstallerFileBox(Gtk.VBox):
def on_download_complete(self, widget, _data=None): def on_download_complete(self, widget, _data=None):
"""Action called on a completed download.""" """Action called on a completed download."""
logger.info("Download completed")
if isinstance(widget, SteamInstaller): if isinstance(widget, SteamInstaller):
self.installer_file.dest_file = widget.get_steam_data_path() self.installer_file.dest_file = widget.get_steam_data_path()
self.emit("file-available") self.emit("file-available")

View file

@ -40,8 +40,10 @@ class InstallerFile:
if self.uses_pga_cache() and os.path.isdir(self.cache_path): if self.uses_pga_cache() and os.path.isdir(self.cache_path):
return self.cached_filename return self.cached_filename
return "" return ""
if self.url.startswith(("$STEAM", "$WINESTEAM")): if self.url.startswith("$STEAM"):
return self.url return self.url
if self.url.startswith("$WINESTEAM"):
raise ScriptingError("Usage of $WINESTEAM location is deprecated")
return os.path.basename(self._file_meta) return os.path.basename(self._file_meta)
@property @property
@ -89,7 +91,7 @@ class InstallerFile:
@property @property
def provider(self): def provider(self):
"""Return file provider used""" """Return file provider used"""
if self.url.startswith(("$WINESTEAM", "$STEAM")): if self.url.startswith("$STEAM"):
return "steam" return "steam"
if self.is_cached: if self.is_cached:
return "pga" return "pga"
@ -103,7 +105,7 @@ class InstallerFile:
def providers(self): def providers(self):
"""Return all supported providers""" """Return all supported providers"""
_providers = set() _providers = set()
if self.url.startswith(("$WINESTEAM", "$STEAM")): if self.url.startswith("$STEAM"):
_providers.add("steam") _providers.add("steam")
if self.is_cached: if self.is_cached:
_providers.add("pga") _providers.add("pga")

View file

@ -16,19 +16,15 @@ class SteamInstaller(GObject.Object):
"""Handles installation of Steam games""" """Handles installation of Steam games"""
__gsignals__ = { __gsignals__ = {
"game-installed": (GObject.SIGNAL_RUN_FIRST, None, (str, )), "steam-game-installed": (GObject.SIGNAL_RUN_FIRST, None, (str, )),
"state-changed": (GObject.SIGNAL_RUN_FIRST, None, (str, )), "steam-state-changed": (GObject.SIGNAL_RUN_FIRST, None, (str, )),
} }
def __init__(self, steam_uri, file_id): def __init__(self, steam_uri, file_id):
""" """
Params: Params:
steam_uri: Colon separated game info containing: steam_uri: Colon separated game info containing:
- $STEAM or $WINESTEAM depending on the version of Steam - $STEAM
Since Steam for Linux can download games for any
platform, using $WINESTEAM has little value except in
some cases where the game needs to be started by Steam
in order to get a CD key (ie. Doom 3 or UT2004)
- The Steam appid - The Steam appid
- The relative path of files to retrieve - The relative path of files to retrieve
file_id: The lutris installer internal id for the game files file_id: The lutris installer internal id for the game files
@ -51,19 +47,8 @@ class SteamInstaller(GObject.Object):
self.appid = appid self.appid = appid
self.path = path self.path = path
if runner_id == "$WINESTEAM": self.platform = "linux"
self.platform = "windows" self.runner = steam.steam()
else:
self.platform = "linux"
@property
def runner(self):
"""Return the runner instance used by this install"""
if not self._runner:
if self.platform == "windows":
self._runner = winesteam.winesteam()
self._runner = steam.steam()
return self._runner
@property @property
def steam_rel_path(self): def steam_rel_path(self):
@ -114,8 +99,9 @@ class SteamInstaller(GObject.Object):
) )
if states and states != self.prev_states: if states and states != self.prev_states:
self.state = states[-1].split(",")[-1] self.state = states[-1].split(",")[-1]
self.emit("state-changed", self.state) # Broadcast new state to listeners
logger.debug("Steam installation status: %s", states) logger.debug("Steam installation status: %s", states)
self.emit("state-changed", self.state) # Broadcast new state to listeners
self.prev_states = states self.prev_states = states
if self.state == "Fully Installed": if self.state == "Fully Installed":
logger.info("Steam game %s has been installed successfully", self.appid) logger.info("Steam game %s has been installed successfully", self.appid)

View file

@ -109,7 +109,7 @@ class SteamService(BaseService):
return steam_games return steam_games
def get_installer_files(self, installer, installer_file_id): def get_installer_files(self, installer, installer_file_id):
steam_uri = "$WINESTEAM:%s:." if installer.runner == "winesteam" else "$STEAM:%s:." steam_uri = "$STEAM:%s:."
appid = str(installer.script["game"]["appid"]) appid = str(installer.script["game"]["appid"])
return [ return [
InstallerFile(installer.game_slug, "steam_game", { InstallerFile(installer.game_slug, "steam_game", {