changed the launch of the system wine when installing the application

This commit is contained in:
Sergey Palcheh
2025-09-22 16:48:49 +06:00
parent 4aebb722ca
commit 998eff3263
2 changed files with 20 additions and 10 deletions

View File

@@ -2126,6 +2126,19 @@ select_component_version() {
done
}
run_install_to_prefix() {
export WINEPREFIX="$1"
local WIN_FILE_EXEC="$2"
if [[ -z "$WINEPREFIX" ]] || [[ -z "$WIN_FILE_EXEC" ]]; then
fatal "Использование: $SCRIPT_NAME install-to-prefix <имя_префикса> <путь_к_установщику>"
fi
check_prefix_var
prepair_wine
wine_run_install "$WIN_FILE_EXEC"
}
run_install_dxvk() {
local version="$1"
if [[ -z "$version" ]] ; then
@@ -2258,6 +2271,7 @@ case "$arg1" in
winetricks) prepair_wine ; "$WH_WINETRICKS" -q "$@" ;;
desktop) create_desktop "$@" ; exit 0 ;;
install|-i) run_autoinstall "$@" ;;
install-to-prefix) run_install_to_prefix "$@" ;;
install-dxvk) run_install_dxvk "$@" ;;
install-vkd3d) run_install_vkd3d "$@" ;;
change-wine) run_change_wine_version "$@" ;;

View File

@@ -2440,7 +2440,7 @@ class WineHelperGUI(QMainWindow):
self.prefix_install_button.setEnabled(path_ok and prefix_selected)
def run_prefix_installer(self):
"""Запускает установку файла в выбранный префикс."""
"""Запускает установку файла в выбранный префикс через скрипт winehelper."""
prefix_name = self.current_managed_prefix_name
installer_path = self.prefix_install_path_edit.text().strip()
@@ -2451,9 +2451,6 @@ class WineHelperGUI(QMainWindow):
QMessageBox.warning(self, "Ошибка", "Указан неверный путь к установочному файлу.")
return
prefix_path = os.path.join(Var.USER_WORK_PATH, "prefixes", prefix_name)
wine_executable = self._get_wine_executable_for_prefix(prefix_name)
self.command_dialog = QDialog(self)
self.command_dialog.setWindowTitle(f"Установка в префикс: {prefix_name}")
self.command_dialog.setMinimumSize(750, 400)
@@ -2477,13 +2474,12 @@ class WineHelperGUI(QMainWindow):
self.command_process.readyReadStandardOutput.connect(self._handle_command_output)
self.command_process.finished.connect(self._handle_prefix_install_finished)
env = QProcessEnvironment.systemEnvironment()
env.insert("WINEPREFIX", prefix_path)
self.command_process.setProcessEnvironment(env)
# Окружение полностью настраивается скриптом winehelper
self.command_process.setProcessEnvironment(QProcessEnvironment.systemEnvironment())
args = [installer_path]
self.command_log_output.append(f"Запуск установки: {shlex.quote(wine_executable)} {shlex.quote(installer_path)}")
self.command_process.start(wine_executable, args)
args = ["install-to-prefix", prefix_name, installer_path]
self.command_log_output.append(f"Выполнение: {shlex.quote(self.winehelper_path)} {' '.join(shlex.quote(a) for a in args)}")
self.command_process.start(self.winehelper_path, args)
self.command_dialog.exec_()
def _get_prefix_component_version(self, prefix_name, component_key):