Пример #1
0
 def _finish_install(self):
     game = self.installer.script.get("game")
     launcher_value = None
     if game:
         _launcher, launcher_value = get_game_launcher(
             self.installer.script)
     path = None
     if launcher_value:
         path = self._substitute(launcher_value)
         if not os.path.isabs(path) and self.target_path:
             path = os.path.join(self.target_path, path)
     self.installer.save()
     if path and not os.path.isfile(path) and self.installer.runner not in (
             "web", "browser"):
         self.parent.set_status(
             _("The executable at path %s can't be found, please check the destination folder.\n"
               "Some parts of the installation process may have not completed successfully."
               ) % path)
         logger.warning("No executable found at specified location %s",
                        path)
     else:
         install_complete_text = (
             self.installer.script.get("install_complete_text")
             or _("Installation completed!"))
         self.parent.set_status(install_complete_text)
     download_lutris_media(self.installer.game_slug)
     self.parent.on_install_finished()
Пример #2
0
 def get_game_launcher_config(self, game_files):
     """Game options such as exe or main_file can be added at the root of the
     script as a shortcut, this integrates them into the game config properly
     This should be deprecated. Game launchers should go in the game section.
     """
     launcher, launcher_value = get_game_launcher(self.script)
     if isinstance(launcher_value, list):
         launcher_values = []
         for game_file in launcher_value:
             if game_file in game_files:
                 launcher_values.append(game_files[game_file])
             else:
                 launcher_values.append(game_file)
         return launcher, launcher_values
     if launcher_value:
         if launcher_value in game_files:
             launcher_value = game_files[launcher_value]
         elif self.interpreter.target_path and os.path.exists(
                 os.path.join(self.interpreter.target_path, launcher_value)
         ):
             launcher_value = os.path.join(self.interpreter.target_path, launcher_value)
     return launcher, launcher_value