Compare commits

...

19 Commits

Author SHA1 Message Date
Mikhail Tergoev
4c39ec3c8e updated doc path 2025-09-11 14:10:24 +03:00
Mikhail Tergoev
8950d8de2f Merge branch 'minergenon-devel' 2025-09-11 13:24:10 +03:00
Sergey Palcheh
85bd5fdf5d the path for reading the THIRD-PARTY file has been fixed 2025-09-11 15:20:09 +06:00
Sergey Palcheh
b98c6e5408 added auto-completion for change-wine 2025-09-11 13:28:50 +06:00
Sergey Palcheh
bab49377a3 added the wine/proton control button to the created prefix 2025-09-11 12:52:04 +06:00
Sergey Palcheh
aa591112ff simplifying the definition of the path to dependencies.sh 2025-09-11 11:12:17 +06:00
Sergey Palcheh
08090bbb6b fixed the winetricks detection path 2025-09-11 10:45:30 +06:00
Mikhail Tergoev
759421d725 Merge branch 'minergenon-devel' 2025-09-10 15:39:03 +03:00
Sergey Palcheh
bf3a30487e fixed paths for determining the installation of system dependencies 2025-09-09 15:19:55 +06:00
Sergey Palcheh
13efa924d8 added auto-completion for installing dxvk/vkd3d 2025-09-09 13:31:39 +06:00
Sergey Palcheh
721fd5e76e added the installation of dxvk/vkd3d in the text interface 2025-09-09 12:55:11 +06:00
Sergey Palcheh
7f3f330fc4 improved result display when searching for dxvk/vkd3d 2025-09-09 10:45:09 +06:00
Sergey Palcheh
1e19fa3c56 added control buttons for dxvk/vkd3d 2025-09-08 21:17:45 +06:00
Sergey Palcheh
a57df9a259 prefix control buttons have been removed from the Installed tab 2025-09-08 16:02:46 +06:00
Sergey Palcheh
3f22b3540e prefix creation is displayed in a separate window 2025-09-08 15:53:32 +06:00
Sergey Palcheh
861b6743fd the Create Prefix tab has been renamed to the Prefix Manager tab 2025-09-08 15:09:29 +06:00
Sergey Palcheh
aa267ad9ef expanded information output in the prefix information window 2025-09-08 15:00:18 +06:00
Sergey Palcheh
3e91bcf241 added the status of the stop app button 2025-09-08 14:10:45 +06:00
Sergey Palcheh
5571f74125 the order of tabs in the Wine/Proton version selection window has been changed 2025-09-08 12:43:11 +06:00
4 changed files with 1056 additions and 295 deletions

View File

@@ -4,7 +4,7 @@ _winehelper_completions() {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --version --debug install installed -r -i remove-all --clear-pfx killall remove-prefix backup-prefix restore-prefix create-prefix --changelog changelog"
opts="--help --version --debug install installed install-dxvk install-vkd3d -r -i remove-all --clear-pfx killall remove-prefix backup-prefix restore-prefix create-prefix --changelog changelog change-wine"
wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run"
case "${prev}" in
@@ -34,6 +34,20 @@ _winehelper_completions() {
restore-prefix)
return 0
;;
install-dxvk|install-vkd3d)
local versions=$(winehelper "${prev}" list 2>/dev/null | grep ' - ' | sed 's/ - //')
COMPREPLY=( $(compgen -W "${versions} none list" -- "${cur}") )
return 0
;;
change-wine)
local wine_versions=$(awk '
/^#+\s*(WINE|WINE_LG|PROTON_LG|PROTON_STEAM)\s*#*$/ { in_group=1 }
/^#+/ { if (! ($0 ~ /^#+\s*(WINE|WINE_LG|PROTON_LG|PROTON_STEAM)\s*#*$/)) in_group=0 }
/^[a-f0-9]{64}/ && in_group { sub(/\.tar\.xz$/, "", $2); print $2 }
' /usr/share/winehelper/sha256sum.list 2>/dev/null)
COMPREPLY=( $(compgen -W "system ${wine_versions}" -- "${cur}") )
return 0
;;
*)
;;
esac

View File

@@ -8,6 +8,8 @@ _winehelper() {
'--version[Показать информацию о пакете и его версии]'
'--debug[Режим отладки]'
'install[Запустить скрипт установки программы]'
'install-dxvk[Установить/удалить DXVK]'
'install-vkd3d[Установить/удалить VKD3D]'
'installed[Список установленных программ]'
'-r[Запуск программы (отладка)]'
'-i[Запустить скрипт установки программы]'
@@ -18,6 +20,7 @@ _winehelper() {
'remove-prefix[Удалить префикс и все связанные данные]'
'backup-prefix[Создать резерную копию префикса]'
'restore-prefix[восстановить префикс из резервной копии "путь/до/whpack"]'
'change-wine[Изменить версию Wine/Proton для префикса]'
)
wine_cmd=(
@@ -61,6 +64,15 @@ _winehelper() {
restore-prefix)
_files
;;
install-dxvk)
_get_component_versions 'install-dxvk'
;;
install-vkd3d)
_get_component_versions 'install-vkd3d'
;;
change-wine)
_get_wine_versions
;;
*)
_values 'winehelper options' "${opts[@]}" "${wine_cmd[@]}"
;;
@@ -69,6 +81,32 @@ _winehelper() {
esac
}
_get_component_versions () {
local component_command=$1
local -a versions
versions=( ${(f)"$(winehelper "${component_command}" list 2>/dev/null | grep ' - ' | sed 's/ - //')" } )
versions+=(none list)
_values 'versions' "${versions[@]}"
}
_get_wine_versions () {
local -a versions
local sha256_file="/usr/share/winehelper/sha256sum.list"
if [[ -f "$sha256_file" ]]; then
versions=( ${(f)"$(awk '
/^#+\s*(WINE|WINE_LG|PROTON_LG|PROTON_STEAM)\s*#*$/ { in_group=1 }
/^#+/ { if (! ($0 ~ /^#+\s*(WINE|WINE_LG|PROTON_LG|PROTON_STEAM)\s*#*$/)) in_group=0 }
/^[a-f0-9]{64}/ && in_group { sub(/\.tar\.xz$/, "", $2); print $2 }
' "$sha256_file" 2>/dev/null)"} )
fi
versions+=(system)
_values 'wine/proton versions' "${versions[@]}"
}
_get_prefixes () {
prefixes=( ${(f)"$(ls -1 ~/.local/share/winehelper/prefixes 2>/dev/null)"} )

View File

@@ -7,18 +7,20 @@ if [[ $(id -u) -eq 0 ]] ; then
fi
##### DEFAULT PATH #####
export SCRIPT_NAME USER_WORK_PATH RUN_SCRIPT DATA_PATH CHANGELOG_FILE WH_ICON_PATH LICENSE_FILE AGREEMENT
export SCRIPT_NAME USER_WORK_PATH RUN_SCRIPT DATA_PATH CHANGELOG_FILE WH_ICON_PATH LICENSE_FILE AGREEMENT THIRD_PARTY_FILE
SCRIPT_NAME="$(basename "$0")"
if [[ "$(realpath "$0")" == "/usr/bin/$SCRIPT_NAME" ]] ; then
# переменные для установленного WineHelper в систему
WH_VERSION="$(rpm -q winehelper | awk -F'-' '{print $2}')"
USER_WORK_PATH="$HOME/.local/share/$SCRIPT_NAME"
RUN_SCRIPT="/usr/bin/$SCRIPT_NAME"
DATA_PATH="/usr/share/$SCRIPT_NAME"
CHANGELOG_FILE="$(realpath "/usr/share/doc/winehelper"-*/CHANGELOG)"
WH_ICON_PATH="$DATA_PATH/image/gui/winehelper.svg"
LICENSE_FILE="$(realpath "/usr/share/doc/winehelper"-*/LICENSE)"
AGREEMENT="$(realpath "/usr/share/doc/winehelper"-*/LICENSE_AGREEMENT)"
CHANGELOG_FILE="/usr/share/doc/winehelper-$WH_VERSION/CHANGELOG"
LICENSE_FILE="/usr/share/doc/winehelper-$WH_VERSION/LICENSE"
AGREEMENT="/usr/share/doc/winehelper-$WH_VERSION/LICENSE_AGREEMENT"
THIRD_PARTY_FILE="/usr/share/doc/winehelper-$WH_VERSION/THIRD_PARTY"
else
# переменные для тестового запуска WineHelper из репозитория
USER_WORK_PATH="$HOME/test-$SCRIPT_NAME"
@@ -28,6 +30,7 @@ else
WH_ICON_PATH="$DATA_PATH/image/gui/winehelper-devel.svg"
LICENSE_FILE="$DATA_PATH/LICENSE"
AGREEMENT="$DATA_PATH/LICENSE_AGREEMENT"
THIRD_PARTY_FILE="$DATA_PATH/THIRD-PARTY"
# минимальная проверка синтаксиса скриптов
for self_check_script in "$RUN_SCRIPT" \
@@ -776,9 +779,10 @@ init_wined3d () {
init_dxvk () {
check_variables USE_DXVK_VER "$1"
get_dxvk () {
DXVK_URL="$1"
DXVK_PACKAGE="${WH_VULKAN_LIBDIR}/dxvk-${DXVK_VAR_VER}.tar.$(echo ${DXVK_URL#*.tar.})"
get_dxvk() {
local DXVK_URL="$1"
local DXVK_VAR_VER="$2"
local DXVK_PACKAGE="${WH_VULKAN_LIBDIR}/${DXVK_VAR_VER}.tar.$(echo "${DXVK_URL#*.tar.}")"
if try_download "$DXVK_URL" "$DXVK_PACKAGE" check256sum \
&& unpack "$DXVK_PACKAGE" "$WH_VULKAN_LIBDIR"
then
@@ -789,8 +793,8 @@ init_dxvk () {
}
for DXVK_VAR_VER in "$USE_DXVK_VER" $@ ; do
if [[ ! -d "${WH_VULKAN_LIBDIR}/dxvk-$DXVK_VAR_VER" ]] ; then
get_dxvk "$CLOUD_URL/dxvk-${DXVK_VAR_VER}.tar.xz"
if [[ ! -d "${WH_VULKAN_LIBDIR}/${DXVK_VAR_VER}" ]] ; then
get_dxvk "$CLOUD_URL/${DXVK_VAR_VER}.tar.xz" "$DXVK_VAR_VER"
fi
done
@@ -803,8 +807,8 @@ init_dxvk () {
fi
for dxvkfiles in $DXVK_FILES ; do
try_copy_other_dll_to_pfx_64 "${WH_VULKAN_LIBDIR}/dxvk-$USE_DXVK_VER/x64/$dxvkfiles.dll"
if try_copy_other_dll_to_pfx_32 "${WH_VULKAN_LIBDIR}/dxvk-$USE_DXVK_VER/x32/$dxvkfiles.dll"
try_copy_other_dll_to_pfx_64 "${WH_VULKAN_LIBDIR}/${USE_DXVK_VER}/x64/$dxvkfiles.dll"
if try_copy_other_dll_to_pfx_32 "${WH_VULKAN_LIBDIR}/${USE_DXVK_VER}/x32/$dxvkfiles.dll"
then var_winedlloverride_update "$dxvkfiles=n"
fi
done
@@ -813,9 +817,10 @@ init_dxvk () {
init_vkd3d () {
check_variables USE_VKD3D_VER "$1"
get_vkd3d () {
VKD3D_URL="$1"
VKD3D_PACKAGE="${WH_VULKAN_LIBDIR}/vkd3d-proton-${VKD3D_VAR_VER}.tar.$(echo ${VKD3D_URL#*.tar.})"
get_vkd3d() {
local VKD3D_URL="$1"
local VKD3D_VAR_VER="$2"
local VKD3D_PACKAGE="${WH_VULKAN_LIBDIR}/${VKD3D_VAR_VER}.tar.$(echo "${VKD3D_URL#*.tar.}")"
if try_download "$VKD3D_URL" "$VKD3D_PACKAGE" check256sum \
&& unpack "$VKD3D_PACKAGE" "$WH_VULKAN_LIBDIR"
then
@@ -826,15 +831,15 @@ init_vkd3d () {
}
for VKD3D_VAR_VER in "$USE_VKD3D_VER" $@ ; do
if [[ ! -d "${WH_VULKAN_LIBDIR}/vkd3d-proton-$VKD3D_VAR_VER" ]] ; then
get_vkd3d "$CLOUD_URL/vkd3d-proton-${VKD3D_VAR_VER}.tar.xz"
if [[ ! -d "${WH_VULKAN_LIBDIR}/${VKD3D_VAR_VER}" ]] ; then
get_vkd3d "$CLOUD_URL/${VKD3D_VAR_VER}.tar.xz" "$VKD3D_VAR_VER"
fi
done
VKD3D_FILES="d3d12 d3d12core libvkd3d-shader-1 libvkd3d-1" # libvkd3d-proton-utils-3
for vkd3dfiles in $VKD3D_FILES ; do
try_copy_other_dll_to_pfx_64 "${WH_VULKAN_LIBDIR}/vkd3d-proton-$USE_VKD3D_VER/x64/$vkd3dfiles.dll"
if try_copy_other_dll_to_pfx_32 "${WH_VULKAN_LIBDIR}/vkd3d-proton-$USE_VKD3D_VER/x86/$vkd3dfiles.dll"
try_copy_other_dll_to_pfx_64 "${WH_VULKAN_LIBDIR}/${USE_VKD3D_VER}/x64/$vkd3dfiles.dll"
if try_copy_other_dll_to_pfx_32 "${WH_VULKAN_LIBDIR}/${USE_VKD3D_VER}/x86/$vkd3dfiles.dll"
then var_winedlloverride_update "$vkd3dfiles=n"
fi
done
@@ -1650,8 +1655,8 @@ select_wine_version() {
read -p "Введите номер для выбора wine/proton (0-$max_choice): " user_choice
if [[ "$user_choice" =~ ^[0-9]+$ ]] && (( user_choice >= 0 && user_choice <= max_choice )); then
if [[ "$user_choice" == "0" ]]; then
print_info "Создание префикса отменено."
exit 0
print_info "Операция отменена."
return 1
fi
local selected_opt
selected_opt="${selectable_options[$user_choice]}"
@@ -1665,6 +1670,7 @@ select_wine_version() {
print_error "Неверный выбор. Введите число от 0 до $max_choice."
fi
done
return 0
}
create_prefix() {
@@ -1714,7 +1720,7 @@ create_prefix() {
*) fatal "Неверный выбор. Операция отменена." ;;
esac
select_wine_version
select_wine_version || exit 0
print_info "Выберите тип создаваемого префикса:"
echo " 0) Отмена создания префикса"
@@ -2011,6 +2017,185 @@ restore_prefix() {
return 0
}
update_last_conf_var() {
local var_name="$1"
local new_value="$2"
local conf_file="$WINEPREFIX/last.conf"
if [[ ! -f "$conf_file" ]] ; then
print_warning "Файл last.conf не найден, не могу обновить переменную $var_name."
return 1
fi
if grep -q "export $var_name=" "$conf_file"; then
sed -i "s|^export $var_name=.*|export $var_name=\"$new_value\"|" "$conf_file"
else
echo "export $var_name=\"$new_value\"" >> "$conf_file"
fi
}
list_component_versions() {
local component_group="$1"
local sha256_file="$DATA_PATH/sha256sum.list"
[[ ! -f "$sha256_file" ]] && fatal "Файл с версиями не найден: $sha256_file"
print_info "Доступные версии для $component_group:"
awk -v group="$component_group" '
/^#+\s*([^#]+?)\s*#*$/ {
current_group = $0
gsub(/^#+\s*|\s*#*$/, "", current_group)
}
/^[a-f0-9]{64}/ {
if (current_group == group) {
filename = $2
sub(/\.tar\.xz$/, "", filename)
print " - " filename
}
}
' "$sha256_file" | sort -Vr
}
select_component_version() {
local component_group="$1"
local sha256_file="$DATA_PATH/sha256sum.list"
[[ ! -f "$sha256_file" ]] && fatal "Файл с версиями не найден: $sha256_file"
local versions=()
local current_group=""
while IFS= read -r line; do
if [[ "$line" =~ ^#+[[:space:]]([^#[:space:]]+)[[:space:]]#* ]] ; then
current_group="${BASH_REMATCH[1]}"
elif [[ "$current_group" == "$component_group" ]] && [[ "$line" =~ [a-f0-9]{64} ]] ; then
local filename
filename=$(echo "$line" | awk '{print $2}')
local version_name=${filename%.tar.xz}
versions+=("$version_name")
fi
done < "$sha256_file"
IFS=$'\n' versions=($(sort -Vr <<<"${versions[*]}"))
unset IFS
if [[ ${#versions[@]} -eq 0 ]] ; then
print_warning "Не найдено доступных версий для $component_group." >&2
return 1
fi
print_info "Выберите версию $component_group для установки:" >&2
echo >&2
local items_to_print=(" 0) Отмена")
for i in "${!versions[@]}" ; do
items_to_print+=(" $((i+1))) ${versions[$i]}")
done
local num_items=${#items_to_print[@]}
local term_width=${COLUMNS:-80}
local max_len=0
for item in "${items_to_print[@]}" ; do
(( ${#item} > max_len )) && max_len=${#item}
done
((max_len+=2))
local num_cols=$(( term_width / max_len ))
(( num_cols = num_cols > 0 ? num_cols : 1 ))
local num_rows=$(( (num_items + num_cols - 1) / num_cols ))
for ((i=0; i<num_rows; i++)) ; do
for ((j=0; j<num_cols; j++)) ; do
local index=$(( i + j * num_rows ))
(( index < num_items )) && printf "%-*s" "$max_len" "${items_to_print[index]}" >&2
done
echo >&2
done
local max_choice=${#versions[@]}
local user_choice
while true; do
echo >&2
read -p "Введите номер (0-$max_choice): " user_choice
if [[ "$user_choice" =~ ^[0-9]+$ ]] && (( user_choice >= 0 && user_choice <= max_choice )) ; then
if [[ "$user_choice" == "0" ]] ; then
return 1
fi
echo "${versions[$((user_choice-1))]}"
return 0
else
print_error "Неверный выбор. Введите число от 0 до $max_choice." >&2
fi
done
}
run_install_dxvk() {
local version="$1"
if [[ -z "$version" ]] ; then
version=$(select_component_version "DXVK")
[[ $? -ne 0 ]] && print_info "Установка DXVK отменена." && return
elif [[ "$version" == "list" ]]; then
list_component_versions "DXVK"
return
fi
check_prefix_var
init_database
init_wine_ver
init_wineprefix
if [[ "$version" == "none" ]] ; then
print_info "Удаление DXVK..."
init_wined3d
update_last_conf_var "DXVK_VER" ""
else
init_dxvk "$version"
update_last_conf_var "DXVK_VER" "$USE_DXVK_VER"
fi
wait_wineserver
}
run_install_vkd3d() {
local version="$1"
if [[ -z "$version" ]] ; then
version=$(select_component_version "VKD3D")
[[ $? -ne 0 ]] && print_info "Установка VKD3D отменена." && return
elif [[ "$version" == "list" ]] ; then
list_component_versions "VKD3D"
return
fi
check_prefix_var
init_database
init_wine_ver
init_wineprefix
if [[ "$version" == "none" ]] ; then
print_info "Удаление VKD3D..."
init_wined3d
update_last_conf_var "VKD3D_VER" ""
else
init_vkd3d "$version"
update_last_conf_var "VKD3D_VER" "$USE_VKD3D_VER"
fi
wait_wineserver
}
run_change_wine_version() {
local new_version="$1"
check_prefix_var
init_database
if [[ -z "$new_version" ]]; then
select_wine_version || exit 0
new_version="$WH_WINE_USE"
else
export WH_WINE_USE="$new_version"
fi
init_wine_ver
init_wineprefix
wait_wineserver
print_ok "Версия Wine для префикса $PREFIX_NAME успешно изменена на $WH_WINE_USE."
}
wh_info () {
echo "Использование: $SCRIPT_NAME [команда]
@@ -2019,6 +2204,10 @@ wh_info () {
install [скрипт] запустить скрипт установки программы
install [скрипт] --clear-pfx не использовать готовый префикс для установки ПО
install-dxvk [версия|none|list] установить, удалить или показать версии DXVK
install-vkd3d [версия|none|list] установить, удалить или показать версии VKD3D
change-wine [версия] изменить версию Wine/Proton для текущего префикса
installed список установленных программ
run [программа] запуск программы (отладка)
remove-all удалить WineHelper и все связанные данные
@@ -2066,6 +2255,9 @@ case "$arg1" in
winetricks) prepair_wine ; "$WH_WINETRICKS" -q "$@" ;;
desktop) create_desktop "$@" ; exit 0 ;;
install|-i) run_autoinstall "$@" ;;
install-dxvk) run_install_dxvk "$@" ;;
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 "$@" ;;

File diff suppressed because it is too large Load Diff