Compare commits

...

11 Commits
0.5.4 ... devel

Author SHA1 Message Date
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 883 additions and 280 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"
wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run"
case "${prev}" in

View File

@@ -8,6 +8,8 @@ _winehelper() {
'--version[Показать информацию о пакете и его версии]'
'--debug[Режим отладки]'
'install[Запустить скрипт установки программы]'
'install-dxvk[Установить/удалить DXVK]'
'install-vkd3d[Установить/удалить VKD3D]'
'installed[Список установленных программ]'
'-r[Запуск программы (отладка)]'
'-i[Запустить скрипт установки программы]'
@@ -61,6 +63,12 @@ _winehelper() {
restore-prefix)
_files
;;
install-dxvk)
_get_component_versions 'install-dxvk'
;;
install-vkd3d)
_get_component_versions 'install-vkd3d'
;;
*)
_values 'winehelper options' "${opts[@]}" "${wine_cmd[@]}"
;;
@@ -69,6 +77,16 @@ _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_prefixes () {
prefixes=( ${(f)"$(ls -1 ~/.local/share/winehelper/prefixes 2>/dev/null)"} )

View File

@@ -776,9 +776,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 +790,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 +804,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 +814,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 +828,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
@@ -2011,6 +2013,164 @@ 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
}
wh_info () {
echo "Использование: $SCRIPT_NAME [команда]
@@ -2019,6 +2179,9 @@ wh_info () {
install [скрипт] запустить скрипт установки программы
install [скрипт] --clear-pfx не использовать готовый префикс для установки ПО
install-dxvk [версия|none|list] установить, удалить или показать версии DXVK
install-vkd3d [версия|none|list] установить, удалить или показать версии VKD3D
installed список установленных программ
run [программа] запуск программы (отладка)
remove-all удалить WineHelper и все связанные данные
@@ -2066,6 +2229,8 @@ 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 "$@" ;;
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