added a more precise definition of the wine version for the prefix being created
This commit is contained in:
		| @@ -424,10 +424,11 @@ class WinetricksManagerDialog(QDialog): | ||||
|         "Для переустановки компонента: Выделите его в списке и нажмите кнопку «Переустановить»." | ||||
|     ) | ||||
|  | ||||
|     def __init__(self, prefix_path, winetricks_path, parent=None): | ||||
|     def __init__(self, prefix_path, winetricks_path, parent=None, wine_executable=None): | ||||
|         super().__init__(parent) | ||||
|         self.prefix_path = prefix_path | ||||
|         self.winetricks_path = winetricks_path | ||||
|         self.wine_executable = wine_executable or 'wine' | ||||
|         self.initial_states = {} | ||||
|         self.apply_process = None | ||||
|         self.installation_finished = False | ||||
| @@ -587,6 +588,7 @@ class WinetricksManagerDialog(QDialog): | ||||
|  | ||||
|         env = QProcessEnvironment.systemEnvironment() | ||||
|         env.insert("WINEPREFIX", self.prefix_path) | ||||
|         env.insert("WINE", self.wine_executable) | ||||
|         # Отключаем winemenubuilder, чтобы избежать зависаний, связанных с 'wineserver -w'. | ||||
|         # Это известная проблема при запуске winetricks из ГУИ. | ||||
|         process.setProcessEnvironment(env) | ||||
| @@ -827,6 +829,7 @@ class WinetricksManagerDialog(QDialog): | ||||
|         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(self.apply_process.readAllStandardOutput().data().decode('utf-8', 'ignore').strip())) | ||||
|         self.apply_process.finished.connect(self.on_apply_finished) | ||||
| @@ -2759,7 +2762,8 @@ class WineHelperGUI(QMainWindow): | ||||
|             QMessageBox.critical(self, "Ошибка", f"Скрипт winetricks не найден в директории:\n{winehelper_dir}") | ||||
|             return | ||||
|  | ||||
|         dialog = WinetricksManagerDialog(prefix_path, winetricks_path, self) | ||||
|         wine_executable = self._get_wine_executable_for_prefix(prefix_name) | ||||
|         dialog = WinetricksManagerDialog(prefix_path, winetricks_path, self, wine_executable=wine_executable) | ||||
|         dialog.exec_() | ||||
|  | ||||
|     def _get_wine_executable_for_prefix(self, prefix_name): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user