From 41232f2315d74427614eca47edf1bea174c1dd66 Mon Sep 17 00:00:00 2001 From: Mikhail Tergoev Date: Tue, 20 Jan 2026 16:53:29 +0300 Subject: [PATCH] added skip check i586 dependencies if wine-wow64 --- dependencies.sh | 20 +++++++++++++------- winehelper | 38 +++++++++++++++++++++++--------------- winehelper_gui.py | 3 +++ 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/dependencies.sh b/dependencies.sh index b608e50..5b7a55f 100755 --- a/dependencies.sh +++ b/dependencies.sh @@ -7,23 +7,29 @@ if [[ $(id -u) -ne 0 ]] ; then fi ##### MESSAGES FUNCTIONS ##### -print_error () { printf "\E[31m%s ВНИМАНИЕ: $@ %s\e[0m\n" ;} -fatal () { print_error "$@" ; exit 1 ;} +if [[ -t 0 ]] ; then + print_error () { printf "\E[31m%s Ошибка: $* %s\e[0m\n" ;} +else + print_error () { echo -e "Ошибка: $*" ;} +fi -##### UPDATE SYSTEM ##### -apt-get update || fatal "Не удалось обновить список доступных пакетов," +fatal () { + print_error "$@ Аварийное завершение работы WineHelper!" + exit 1 +} ##### CHECK AREPO (x86_64-i586) ##### apt-repo | grep -q "x86_64-i586" || fatal "Репозиторий x86_64-i586 не подключен. \ 32-битные зависимости не будут установлены, а значит не будут работать и 32-битные \ windows приложения. Подробнее по ссылке: https://www.altlinux.org/Biarch" +##### UPDATE SYSTEM ##### +apt-get update || fatal "Не удалось обновить список доступных пакетов," + ##### INSTALL DEPENDENCIES ##### # fonts-ttf-ms -apt-get install {i586-,}{glibc-core,libstdc++6,glibc-pthread,glibc-nss,\ +apt-get install i586-{wine,glibc-core,libstdc++6,glibc-pthread,glibc-nss,\ libnm,libnss,libnss-mdns,libnsl1,libunwind,libunixODBC2,ocl-icd,libfreetype,\ libcups,libfontconfig1,libgnutls30,libGL,libEGL,libvulkan1,xorg-dri-swrast,\ xorg-dri-intel,xorg-dri-radeon} || fatal "Не удалось установить зависимости." - -apt-get install {i586-,}wine diff --git a/winehelper b/winehelper index 0468ee7..c7fb8e3 100755 --- a/winehelper +++ b/winehelper @@ -208,15 +208,23 @@ su_run () { } ##### CHECK DEPENDENCIES ##### -# fonts-ttf-ms - check_deps_i586 () { - if [[ $WH_USE_GUI != "1" ]] && [[ -t 0 ]] \ - && ! rpm -q {i586-,}{wine,glibc-core,libstdc++6,glibc-pthread,glibc-nss,\ - libnm,libnss,libnss-mdns,libnsl1,libunwind,libunixODBC2,ocl-icd,libfreetype,\ - libcups,libfontconfig1,libgnutls30,libGL,libEGL,libvulkan1,xorg-dri-swrast,\ - xorg-dri-intel,xorg-dri-radeon} 1>/dev/null + if [[ $WH_USE_GUI != "1" ]] && [[ ! -t 0 ]] ; then + print_warning "Скрипт запущен из desktop файла." + return 0 + fi + + if [[ $WH_SKIP_DEPS == "1" ]] ; then + unset WH_SKIP_DEPS + return 0 + fi + + if ! rpm -q i586-{wine,glibc-core,libstdc++6,glibc-pthread,glibc-nss,\ +libnm,libnss,libnss-mdns,libnsl1,libunwind,libunixODBC2,ocl-icd,libfreetype,\ +libcups,libfontconfig1,libgnutls30,libGL,libEGL,libvulkan1,xorg-dri-swrast,\ +xorg-dri-intel,xorg-dri-radeon} 1>/dev/null then + print_warning "Необходимо установить 32-битные зависимости!" if su_run "$DATA_PATH/dependencies.sh" then print_info "Зависимости успешно установлены. Продолжаем работу $SCRIPT_NAME" else fatal "Не удалось установить зависимости. Работа $SCRIPT_NAME прервана." @@ -785,13 +793,6 @@ check_installed_programs () { [[ -n $2 ]] && fatal "Не найден файл запуска для $2" } -run_installed_programs () { - if check_installed_programs check_only "$1" ; then - /usr/bin/env bash -c "\"$RUN_SCRIPT\" \"$EXE_PATH\"" & - exit 0 - fi -} - copy_wined3d () { for wined3dfiles in $1 ; do try_copy_wine_dll_to_pfx_64 "$wined3dfiles.dll" @@ -2622,7 +2623,6 @@ case "$arg1" in install-vkd3d) run_install_vkd3d "$@" ;; change-wine) run_change_wine_version "$@" ;; installed) check_installed_programs "$1" ;; - run|-r) run_installed_programs "$1" ;; backup-prefix) backup_prefix "$@" ;; restore-prefix) restore_prefix "$@" ;; remove-all) remove_winehelper "$@" ;; @@ -2631,6 +2631,14 @@ case "$arg1" in create-base-pfx) create_base_pfx "$@" ;; init-prefix) prepair_wine ; wait_wineserver ;; clear-winetricks-cache) clear_winetricks_cache "$@" ;; + run|-r) + if check_installed_programs check_only "$1" ; then + WIN_FILE_EXEC="$(readlink -f "$EXE_PATH")" + shift + prepair_wine + wine_run "$WIN_FILE_EXEC" "$@" + fi + ;; *) if [[ -f "$arg1" ]] ; then WIN_FILE_EXEC="$(readlink -f "$arg1")" diff --git a/winehelper_gui.py b/winehelper_gui.py index 4affe8c..0fac558 100644 --- a/winehelper_gui.py +++ b/winehelper_gui.py @@ -3948,6 +3948,8 @@ class WineHelperGUI(QMainWindow): QMessageBox.critical(self, "Ошибка", f"Не удалось модифицировать команду для отладки: {e}") return + os.environ["WH_SKIP_DEPS"] = "1" + process = QProcess() env = QProcessEnvironment.systemEnvironment() @@ -3980,6 +3982,7 @@ class WineHelperGUI(QMainWindow): self.running_apps[desktop_path] = process self._set_run_button_state(True) print(f"Запущено: {program} {' '.join(arguments)}") + os.environ["WH_SKIP_DEPS"] = "0" except Exception as e: QMessageBox.critical(self, "Ошибка запуска", f"Не удалось запустить команду:\n{command_str}\n\nОшибка: {str(e)}")