Beispiel #1
0
 def get_wine_version_choices():
     version_choices = [('Custom (select executable below)', 'custom')]
     labels = {
         'winehq-devel': 'WineHQ devel ({})',
         'winehq-staging': 'WineHQ staging ({})',
         'wine-development': 'Wine Development ({})',
         'system': 'System ({})',
     }
     versions = get_wine_versions()
     for version in versions:
         if version in labels.keys():
             version_number = get_system_wine_version(
                 WINE_PATHS[version])
             label = labels[version].format(version_number)
         else:
             label = version
         version_choices.append((label, version))
     return version_choices
Beispiel #2
0
    def check_runner_install(self):
        """Check if the runner is installed before starting the installation
        Install the required runner(s) if necessary. This should handle runner
        dependencies (wine for winesteam) or runners used for installer tasks.
        """
        required_runners = []
        runner = self.get_runner_class(self.runner)
        if runner.depends_on is not None:
            required_runners.append(runner.depends_on())
        required_runners.append(runner())

        for command in self.script.get('installer', []):
            command_name, command_params = self._get_command_name_and_params(
                command)
            if command_name == 'task':
                runner_name, _task_name = self._get_task_runner_and_name(
                    command_params['name'])
                runner_names = [r.name for r in required_runners]
                if runner_name not in runner_names:
                    required_runners.append(
                        self.get_runner_class(runner_name)())

        for runner in required_runners:
            params = {}
            if self.runner == 'libretro':
                params['core'] = self.script['game']['core']
            if self.runner.startswith('wine'):
                params['min_version'] = wine.MIN_SAFE_VERSION
                version = self._get_runner_version()
                if version:
                    params['version'] = version
                    # Force the wine version to be installed
                    params['fallback'] = False
            if not runner.is_installed(**params):
                self.runners_to_install.append(runner)

        if self.runner.startswith('wine') and not get_system_wine_version():
            WineNotInstalledWarning(parent=self.parent)
        self.install_runners()