Compare commits

...
2 Commits
2 changed files with 9 additions and 9 deletions

No files matched your search

+1 -1
View File
@@ -2215,7 +2215,7 @@ class WineHelperGUI(QMainWindow):
winetricks_path = EnvironmentConfig.WH_WINETRICKS
wine_executable = self._get_wine_executable_for_prefix(prefix_name)
dialog = WinetricksManagerDialog(prefix_path, winetricks_path, self, wine_executable=wine_executable)
dialog = WinetricksManagerDialog(prefix_path, winetricks_path, self, wine_executable=wine_executable, winehelper_path=self.winehelper_path)
dialog.installation_complete.connect(lambda: self.update_prefix_info_display(prefix_name))
dialog.exec_()
+8 -8
View File
@@ -53,11 +53,12 @@ class WinetricksManagerDialog(QDialog):
installation_complete = pyqtSignal()
def __init__(self, prefix_path, winetricks_path, parent=None, wine_executable=None):
def __init__(self, prefix_path, winetricks_path, parent=None, wine_executable=None, winehelper_path=None):
super().__init__(parent)
self.prefix_path = prefix_path
self.winetricks_path = winetricks_path
self.wine_executable = wine_executable or 'wine'
self.winehelper_path = winehelper_path or 'winehelper'
self.initial_states = {}
self.apply_process = None
self.installation_finished = False
@@ -229,11 +230,10 @@ class WinetricksManagerDialog(QDialog):
env = QProcessEnvironment.systemEnvironment()
env.insert("WINEPREFIX", self.prefix_path)
env.insert("WINE", self.wine_executable)
process.setProcessEnvironment(env)
process.finished.connect(partial(self._on_load_finished, category))
process.start(self.winetricks_path, [category, "list"])
process.start(self.winehelper_path, ["winetricks", category, "list"])
def _parse_winetricks_log(self):
"""Читает winetricks.log и возвращает множество установленных компонентов."""
@@ -423,7 +423,7 @@ class WinetricksManagerDialog(QDialog):
# Устанавливает новые компоненты (без --force)
if verbs_to_install:
self._log(f"Выполнение установки: winetricks --unattended {' '.join(verbs_to_install)}")
self._log(f"Выполнение установки: winehelper winetricks {' '.join(verbs_to_install)}")
self._run_winetricks_process(verbs_to_install, use_force=False)
# Переустанавливает компоненты (с --force)
@@ -431,7 +431,7 @@ class WinetricksManagerDialog(QDialog):
if verbs_to_install:
# Если уже что-то устанавливается, добавляем небольшую задержку
self._log("\n---\n")
self._log(f"Выполнение переустановки: winetricks --unattended --force {' '.join(verbs_to_reinstall)}")
self._log(f"Выполнение переустановки: winehelper winetricks --force {' '.join(verbs_to_reinstall)}")
self._run_winetricks_process(verbs_to_reinstall, use_force=True)
def _run_winetricks_process(self, verbs, use_force=False):
@@ -441,7 +441,7 @@ class WinetricksManagerDialog(QDialog):
verbs: Список компонентов для установки
use_force: Использовать ли флаг --force
"""
args = ["--unattended"]
args = []
if use_force:
args.append("--force")
args.extend(verbs)
@@ -449,9 +449,9 @@ class WinetricksManagerDialog(QDialog):
if not self.apply_process:
self.apply_process = QProcess(self)
self.apply_process.setProcessChannelMode(QProcess.MergedChannels)
env = QProcessEnvironment.systemEnvironment()
env.insert("WINEPREFIX", self.prefix_path)
env.insert("WINE", self.wine_executable)
self.apply_process.setProcessEnvironment(env)
self.apply_process.readyReadStandardOutput.connect(
lambda: self.log_output.append(
@@ -460,7 +460,7 @@ class WinetricksManagerDialog(QDialog):
)
self.apply_process.finished.connect(self.on_apply_finished)
self.apply_process.start(self.winetricks_path, args)
self.apply_process.start(self.winehelper_path, ["winetricks"] + args)
def on_apply_finished(self, exit_code, exit_status):
"""Обрабатывает завершение применения изменений."""