diff --git a/docs/installers.rst b/docs/installers.rst index 732e1a239..1aecc52b3 100644 --- a/docs/installers.rst +++ b/docs/installers.rst @@ -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...`` ``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`` ``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. 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``, 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 -``$GAMEDIR``. For WineSteam games, set it to ``$GAMEDIR/prefix`` to isolate the -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. +``$GAMEDIR``. -DRM free Steam and WineSteam -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +DRM free Steam +^^^^^^^^^^^^^^ Lutris has the ability to run Steam games without launching the Steam client. This is only possible with certain games lacking the Steam DRM. @@ -368,8 +365,8 @@ Examples:: referer: www.mywebsite.com -If the game makes use of (Windows) Steam data, the value should be -``$WINESTEAM:appid:path/to/data``. This will check that the data is available +If the game makes use of Steam data, the value should be +``$STEAM:appid:path/to/data``. This will check that the data is available or install it otherwise. @@ -602,8 +599,8 @@ with ``wine.wineexec`` as the task's ``name``) Currently, the following tasks are implemented: -* wine / winesteam: ``create_prefix`` Creates an empty Wine prefix at the - specified path. The other wine/winesteam directives below include the +* wine: ``create_prefix`` Creates an empty Wine prefix at 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 create_prefix command. Parameters are: @@ -626,7 +623,7 @@ Currently, the following tasks are implemented: name: create_prefix 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 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 @@ -641,7 +638,7 @@ Currently, the following tasks are implemented: executable: drive_c/Program Files/Game/Game.exe 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). 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 -* 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). Example: @@ -666,7 +663,7 @@ Currently, the following tasks are implemented: - task: 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``, ``type`` (optional value type, default is REG_SZ (string)), ``prefix`` (optional WINEPREFIX), ``arch`` @@ -683,7 +680,7 @@ Currently, the following tasks are implemented: value: '00000000' 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`` (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' 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), ``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 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), ``arch`` (optional architecture of the prefix, required when you created win64 prefix). diff --git a/lutris/gui/dialogs/runner_install.py b/lutris/gui/dialogs/runner_install.py index f4e56e68e..4256d6e09 100644 --- a/lutris/gui/dialogs/runner_install.py +++ b/lutris/gui/dialogs/runner_install.py @@ -1,16 +1,13 @@ """Dialog used to install versions of a runner""" -import gettext -# Standard Library # pylint: disable=no-member +import gettext import os import random from collections import defaultdict from gettext import gettext as _ -# Third Party Libraries from gi.repository import GLib, Gtk -# Lutris Modules from lutris import api, settings from lutris.database.games import get_games_by_runner from lutris.game import Game @@ -242,8 +239,6 @@ class RunnerInstallDialog(Dialog): def get_usage_stats(self): """Return the usage for each version""" runner_games = get_games_by_runner(self.runner) - if self.runner == "wine": - runner_games += get_games_by_runner("winesteam") version_usage = defaultdict(list) for db_game in runner_games: if not db_game["installed"]: diff --git a/lutris/gui/installer/file_box.py b/lutris/gui/installer/file_box.py index c69a09833..0bc6eebf7 100644 --- a/lutris/gui/installer/file_box.py +++ b/lutris/gui/installer/file_box.py @@ -86,15 +86,14 @@ class InstallerFileBox(Gtk.VBox): if self.provider == "steam": steam_installer = SteamInstaller(self.installer_file.url, self.installer_file.id) - steam_installer.connect("game-installed", self.on_download_complete) - steam_installer.connect("state-changed", self.on_state_changed) + steam_installer.connect("steam-game-installed", self.on_download_complete) + steam_installer.connect("steam-state-changed", self.on_state_changed) self.start_func = steam_installer.install_steam_game self.stop_func = steam_installer.stop_func steam_box = Gtk.HBox(spacing=6) info_box = Gtk.VBox(spacing=6) - steam_label = InstallerLabel(_("Steam game for {platform} (appid: {appid})").format( - platform=steam_installer.platform, + steam_label = InstallerLabel(_("Steam game {appid}").format( appid=steam_installer.appid )) info_box.add(steam_label) @@ -277,6 +276,7 @@ class InstallerFileBox(Gtk.VBox): def on_download_complete(self, widget, _data=None): """Action called on a completed download.""" + logger.info("Download completed") if isinstance(widget, SteamInstaller): self.installer_file.dest_file = widget.get_steam_data_path() self.emit("file-available") diff --git a/lutris/installer/installer_file.py b/lutris/installer/installer_file.py index d17ff6904..ed9deb151 100644 --- a/lutris/installer/installer_file.py +++ b/lutris/installer/installer_file.py @@ -40,8 +40,10 @@ class InstallerFile: if self.uses_pga_cache() and os.path.isdir(self.cache_path): return self.cached_filename return "" - if self.url.startswith(("$STEAM", "$WINESTEAM")): + if self.url.startswith("$STEAM"): return self.url + if self.url.startswith("$WINESTEAM"): + raise ScriptingError("Usage of $WINESTEAM location is deprecated") return os.path.basename(self._file_meta) @property @@ -89,7 +91,7 @@ class InstallerFile: @property def provider(self): """Return file provider used""" - if self.url.startswith(("$WINESTEAM", "$STEAM")): + if self.url.startswith("$STEAM"): return "steam" if self.is_cached: return "pga" @@ -103,7 +105,7 @@ class InstallerFile: def providers(self): """Return all supported providers""" _providers = set() - if self.url.startswith(("$WINESTEAM", "$STEAM")): + if self.url.startswith("$STEAM"): _providers.add("steam") if self.is_cached: _providers.add("pga") diff --git a/lutris/installer/steam_installer.py b/lutris/installer/steam_installer.py index 010614853..06f45e5ec 100644 --- a/lutris/installer/steam_installer.py +++ b/lutris/installer/steam_installer.py @@ -16,19 +16,15 @@ class SteamInstaller(GObject.Object): """Handles installation of Steam games""" __gsignals__ = { - "game-installed": (GObject.SIGNAL_RUN_FIRST, None, (str, )), - "state-changed": (GObject.SIGNAL_RUN_FIRST, None, (str, )), + "steam-game-installed": (GObject.SIGNAL_RUN_FIRST, None, (str, )), + "steam-state-changed": (GObject.SIGNAL_RUN_FIRST, None, (str, )), } def __init__(self, steam_uri, file_id): """ Params: steam_uri: Colon separated game info containing: - - $STEAM or $WINESTEAM depending on the version of 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) + - $STEAM - The Steam appid - The relative path of files to retrieve file_id: The lutris installer internal id for the game files @@ -51,19 +47,8 @@ class SteamInstaller(GObject.Object): self.appid = appid self.path = path - if runner_id == "$WINESTEAM": - self.platform = "windows" - 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 + self.platform = "linux" + self.runner = steam.steam() @property def steam_rel_path(self): @@ -114,8 +99,9 @@ class SteamInstaller(GObject.Object): ) if states and states != self.prev_states: self.state = states[-1].split(",")[-1] - self.emit("state-changed", self.state) # Broadcast new state to listeners logger.debug("Steam installation status: %s", states) + self.emit("state-changed", self.state) # Broadcast new state to listeners + self.prev_states = states if self.state == "Fully Installed": logger.info("Steam game %s has been installed successfully", self.appid) diff --git a/lutris/services/steam.py b/lutris/services/steam.py index 14951cdbc..015759716 100644 --- a/lutris/services/steam.py +++ b/lutris/services/steam.py @@ -109,7 +109,7 @@ class SteamService(BaseService): return steam_games 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"]) return [ InstallerFile(installer.game_slug, "steam_game", {