Compare commits

...

46 Commits

Author SHA1 Message Date
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
Mikhail Tergoev
a15b2621b6 updated changelog to 0.5.4 2025-09-04 16:03:30 +03:00
Mikhail Tergoev
fd00b61c71 added function: find_prefix 2025-09-04 15:53:40 +03:00
Mikhail Tergoev
74eaf34c00 Merge branch 'minergenon-devel' 2025-09-04 12:27:48 +03:00
Sergey Palcheh
a69493df73 database: changed WINEPREFIX=tflex17 to WINEPREFIX=tflex 2025-09-03 10:22:11 +06:00
Sergey Palcheh
6b958dd7f1 added a bash-c call to improve script compatibility 2025-09-03 10:18:52 +06:00
Mikhail Tergoev
2483f4c66c Merge branch 'minergenon-devel' 2025-09-02 17:28:44 +03:00
Sergey Palcheh
ab0e23952e added a button to create a program shortcut
the function of extracting an icon from an exe file is combined with the creation of a desktop file
added the function of automatic prefix detection if it is not specified
2025-09-02 16:23:39 +06:00
Sergey Palcheh
92a682ba8a added a more explicit error message when installing dependencies 2025-09-02 10:44:37 +06:00
Sergey Palcheh
3381054c21 added a winehelper launch button when dependencies are successfully installed 2025-09-02 10:23:44 +06:00
Sergey Palcheh
76b7d4f046 removed the dependency installation success window 2025-09-02 10:11:47 +06:00
Sergey Palcheh
aeae544640 added 64bit versions of wine/proton to the 32bit prefix 2025-09-02 09:50:27 +06:00
Sergey Palcheh
eeb94523b3 the refresh list button has been removed 2025-09-02 09:33:35 +06:00
Sergey Palcheh
a2186b63cb renaming Proton/Wine Lg buttons to LG 2025-09-02 09:25:01 +06:00
Mikhail Tergoev
839b480c39 updated sha256sum.list 2025-09-01 12:06:10 +03:00
Sergey Palcheh
504be8ea5b fixed typos 2025-08-29 10:21:26 +06:00
Sergey Palcheh
662a62267c changed the download and selection of wine/proton versions on the cloud 2025-08-28 21:15:39 +06:00
Sergey Palcheh
b4d663f2a7 added a more precise definition of the wine version for the prefix being created 2025-08-26 11:42:10 +06:00
Sergey Palcheh
c5db176ca4 the component manager has been restored 2025-08-26 11:16:50 +06:00
Sergey Palcheh
d73c0a47ab code block removed from _handle_prefix_creation_output method 2025-08-26 10:43:11 +06:00
Sergey Palcheh
aadd579cdc added the ability to install the application in the created prefix 2025-08-25 16:58:42 +06:00
Sergey Palcheh
0608a3f250 the Management header has been deleted 2025-08-25 15:56:47 +06:00
Sergey Palcheh
274a21941d added deletion of the created prefix 2025-08-25 15:43:34 +06:00
Sergey Palcheh
d499147bdc added the choice of a prefix to be created for management 2025-08-25 15:20:57 +06:00
Sergey Palcheh
dd5d8bb657 changes to the default fill button 2025-08-25 14:41:40 +06:00
Sergey Palcheh
f73f717d0e the prefix control unit has been added to the Create prefix tab 2025-08-25 14:19:45 +06:00
Sergey Palcheh
cefb3c8d5a changing the tab display in the main window 2025-08-25 13:03:36 +06:00
Sergey Palcheh
a4f01e7340 refactoring the install_current_script() method 2025-08-25 11:33:45 +06:00
Sergey Palcheh
70f2976a70 fixed the display in the wine version selection bar 2025-08-25 11:13:24 +06:00
Sergey Palcheh
34713bb61a added a prefix creation tab 2025-08-24 20:56:34 +06:00
Sergey Palcheh
eea04f0d91 added separation of wine/proton display by groups 2025-08-23 22:04:29 +06:00
Sergey Palcheh
45bc97d796 added wine/proton separation by prefix bit depth 2025-08-23 20:00:47 +06:00
Sergey Palcheh
88f1febf54 added the function of selecting the wine version with improved downloads 2025-08-23 16:07:26 +06:00
Sergey Palcheh
c756459993 added generation of wine metadata 2025-08-22 18:09:12 +06:00
Sergey Palcheh
b97b2169ab added prefix creation 2025-08-22 13:14:48 +06:00
7 changed files with 2159 additions and 284 deletions

View File

@@ -1,5 +1,14 @@
История изменений:
0.5.4:
* обновлен графический режим Qt5:
- добавлена возможность установки системных зависимостей
- исправлены/улучшены основные функции
- добавлено управление префиксами (в разработке)
- добавлена возможность создания ярлыка
* добавлено автоматическое создание иконки для ярлыков (desktop файлов)
* префикс tflex17 переименован в tflex (т.к. 18-я версия работает в том же префиксе)
0.5.3:
* исправлена установка grdcontrol для t-flex-*
* обновлен графический режим Qt5

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 --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,12 +8,15 @@ _winehelper() {
'--version[Показать информацию о пакете и его версии]'
'--debug[Режим отладки]'
'install[Запустить скрипт установки программы]'
'install-dxvk[Установить/удалить DXVK]'
'install-vkd3d[Установить/удалить VKD3D]'
'installed[Список установленных программ]'
'-r[Запуск программы (отладка)]'
'-i[Запустить скрипт установки программы]'
'remove-all[Удалить WineHelper и все связанные данные]'
'--clear-pfx[Очистить префикс \[имя_префикса\]]'
'killall[Убить все процессы]'
'create-prefix[Создать новый префикс]'
'remove-prefix[Удалить префикс и все связанные данные]'
'backup-prefix[Создать резерную копию префикса]'
'restore-prefix[восстановить префикс из резервной копии "путь/до/whpack"]'
@@ -55,9 +58,17 @@ _winehelper() {
remove-prefix|backup-prefix)
_get_prefixes
;;
create-prefix)
;;
restore-prefix)
_files
;;
install-dxvk)
_get_component_versions 'install-dxvk'
;;
install-vkd3d)
_get_component_versions 'install-vkd3d'
;;
*)
_values 'winehelper options' "${opts[@]}" "${wine_cmd[@]}"
;;
@@ -66,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

@@ -5,7 +5,7 @@ export WH_WINDOWS_VER="10"
export WH_WINE_USE="wine_wh_tflex_10-9_amd64"
export BASE_PFX="tflex17_pfx_x64_v02"
export WINEARCH="win64"
export WINEPREFIX="tflex17"
export WINEPREFIX="tflex"
export PROG_VERSION=""
export WH_XDG_OPEN="log"
export INSTALL_DLL="corefonts d3dcompiler_47 dotnet48 vcrun2022 ucrtbase2019 msxml6 fontsmooth=rgb baekmuk droid eufonts ipamona liberation lucida opensymbol sourcehansans tahoma takao uff unifont vlgothic wenquanyi wenquanyizenhei"

7
sha256sum.list Executable file → Normal file
View File

@@ -1,5 +1,4 @@
##### WINE #####
009c95bfe2df3f9264c9c5092f3e30ea7a168dd7869046058a718a70739602d4 wine_wh_tflex_10-9_amd64.tar.xz
3571c40a787f0386e0160b5d471b1bf11fa2a235b497156cd38198b90bcb4a9f wine_x_tkg_10-0_i586.tar.xz
71d6fdfd23d7988471d345c68e81699b8af931352b03dd216424b398f63c7b12 wine_x_tkg_10-0_amd64.tar.xz
@@ -9,6 +8,7 @@ e0a84bb4908c3927954d7eef6b8ac7212e442b8c107d000c6890fec340f96183 wine-9.0.14-al
61bec1230b37b8fcc69fd45f848b44fd88cc41fcdd5dc3080336d7da63660f40 wine-7.16.1-alt1-amd64.tar.xz
6fea17fd131f57c2ebf7ca4c60d3c5a9e819afe16e5d0b77ecb750da99ae0e38 wine-7.16.1-alt1-i586.tar.xz
##### WINE_LG #####
765e52484f06169909b179f4884d04ae4b440ff868e4b5722e64fc7d7a036ad9 WINE_LG_10-10-1.tar.xz
7a5128fcebbeed652ba36c5135821fd2c82493e87d715e8bc63e3210ba7ee849 WINE_LG_10-11.tar.xz
373beeb85c1c8163e752a32a453dcf575dd7ecf971726cecb3195e330d094925 WINE_LG_10-12.tar.xz
@@ -25,6 +25,7 @@ da79f89b1fc3175f113bf5ec35fc2755550159034736cff086f2165480dd6e0f WINE_LG_9-12-2
51ff56e435a90eeff13ffbbac543a820d1df14d65f2e3b760ad100bc946e4bfc WINE_LG_9-7.tar.xz
09901b17a7aaa13e5c1a1f99ab82c9f0d223aa2f5c9ac94938e5a9a0088bb244 WINE_LG_9-9.tar.xz
##### PROTON_LG #####
d0f5b42096bc5ed379a26e415d99963f849129d5cec1ba9134b1ee50100b049b PROTON_LG_10-10.tar.xz
d87eb914ce7e5cab47e6b480aa400f8c7840f39a22d585bf35092a033ac09201 PROTON_LG_10-13.tar.xz
05ca56607af7cee30b4797ad6c6a111d38a52c9d5c2184d30eec2650f1585b58 PROTON_LG_10-15.tar.xz
@@ -44,13 +45,13 @@ e09c5da9ddffc5d390de7689df1778f279cc84a946665cc76ce77861010b2604 PROTON_LG_9-4.
56eae794a48aa7322ce5a636c490974d7f2516528d3153991fb033b0fa5fe3cf PROTON_LG_9-5.tar.xz
82263e1d0ab16130f15d419f2661fc5a7baf29193b9eeeb7eec3f01a3e54a1b3 PROTON_LG_9-7.tar.xz
##### PROTON_STEAM #####
09e6e386a87710996d634e08650bbc733365df65d3491a4372f06cf4e815a8b2 PROTON_STEAM_6.3-8.tar.xz
2f8bdfeb75e5427886aac7d2a599a1ee8900e50d5873a0e620d5703707bf4271 PROTON_STEAM_7.0-5.tar.xz
b33aca95664067c9eff06a2b4380992d43a5d31880ff970fb340e851671be625 PROTON_STEAM_8.0-4.tar.xz
9a20af28f4213e4f1c532b79a20e6a95ef872130784fc306510637342c6f58a1 PROTON_STEAM_8.0-5.tar.xz
##### DXVK #####
d1a86ca53ab7e156e1252d3cf7eed3c66fe0651699cfc9c4ba152024261d8258 dxvk-1.10.1-967.tar.xz
98411effbc1b3611b11c4ca3af2ad29400b08e1c8c380791d6351600a06fb3c7 dxvk-1.10.3-28.tar.xz
061568b51ce99d285ef2d0f1f31aab65b3e6fd34747073859c5a719bec2a7afd dxvk-1.6.1.tar.xz
@@ -100,7 +101,6 @@ c02b565d2fca1dc4066fb58acfcdd3919386fdbb01b30cfe181d4dd02ac5f1bb dxvk-2.7-5.tar
5f97deb1eeb97ed41d0539264c0ca98e8841f79ec59684f32e7f1ca5c29a109b dxvk-sarek-1.11.0.tar.xz
##### VKD3D #####
df1a940d2e072a884524f66a16e0f0ef74048bc6a6642b96eb257528a522109f vkd3d-proton-1.1-2602.tar.xz
bc86b06af83054e25bad21fe4bec4c10538837221fe847470571df7d556d355b vkd3d-proton-1.1-2967.tar.xz
41bd2465015f069ef2d378e42a0f906fd40f1ce70e1602b36e445209b16e0d50 vkd3d-proton-1.1-3088.tar.xz
@@ -154,7 +154,6 @@ edf16d2b37bc77d121d5d81b06b60d3f694e0060c6606e729ceab30de3d27466 vkd3d-proton-s
405bfe3b7c7f80034837c05656535053305727ee4bf1d993521b67b71d08ebc6 extra_fonts_v01.tar.xz
##### PREFIX #####
0e86cd9958d1bd1bfac99e23165a091a4ea2fa3e693c551f69aabeed5f681fea defpfx_x86_v01.tar.xz
# create with wine_x_tkg_10-0_amd64 (universal user: xuser and isolate_home by default)
# winetricks msxml3 msxml4 msxml6 andale arial comicsans courier georgia impact times trebuchet verdana webdings corefonts wsh57 vcrun6 mdac27 jet40 gdiplus lucida tahoma ucrtbase2019 vcrun2019

View File

@@ -190,7 +190,7 @@ su_run () {
((i++))
done
else
pkexec "$@" && return 0
pkexec bash -c "$@" && return 0
fi
fatal "Не удалось установить необходимые компоненты!"
}
@@ -509,63 +509,41 @@ var_ld_library_path_update () {
return 0
}
extract_icon() {
check_prefix_var
local exe_file="$1"
local ico_name="$(basename "$exe_file" .exe).ico"
local png_name="$(basename "$exe_file" .exe).png"
local tmp_ico_dir="$WH_TMP_DIR/icons"
local user_icons="$WINEPREFIX/icons"
create_new_dir "$tmp_ico_dir"
if ! wrestool -x -t 14 "$exe_file" -o "$tmp_ico_dir/$ico_name" ; then
print_warning "Не удалось извлечь иконку из $exe_file"
try_remove_file "$tmp_ico_dir"
return 1
find_prefix () {
# Автоматическое определение префикса, если он не задан
if [[ -z "$WINEPREFIX" ]] && [[ "$1" == "$WH_PREFIXES_DIR"* ]]; then
local extracted_prefix
extracted_prefix="$(echo "$1" | grep -o ".*/prefixes/[^/]*")"
if [[ -d "$extracted_prefix" ]]; then
export WINEPREFIX="$extracted_prefix"
print_info "Префикс автоматически определен: $(basename "$WINEPREFIX")"
fi
fi
if ! icotool -x -i 1 "$tmp_ico_dir/$ico_name" -o "$tmp_ico_dir/$png_name" ; then
print_warning "Не удалось извлечь иконку из $ico_name"
try_remove_file "$tmp_ico_dir"
return 1
fi
create_new_dir "$user_icons"
if ! try_copy_file "$tmp_ico_dir/$png_name" "$user_icons" ; then
print_warning "Не удалось копировать иконку в префикс"
try_remove_file "$user_icons"
return 1
fi
try_remove_dir "$tmp_ico_dir"
print_ok "Иконка сохранена: $user_icons/$png_name"
return 0
}
create_desktop () {
local name_desktop exe_file desktop_filename icon_file desktop_path
local name_desktop exe_file desktop_filename icon_file desktop_path icon_arg desktop_filename_arg
name_desktop="$1"
exe_file="$2"
if [[ -n $4 ]] && [[ $4 != "nocopy" ]];
then desktop_filename="$4"
else desktop_filename="$(basename "$exe_file" .exe | sed "s| |_|")"
fi
if [[ "$RESTORE_FROM_BACKUP" == "1" ]] && [[ -f "$3" ]]
then icon_file="$3"
elif [[ -f "$WH_IMAGE_PATH/$3.png" ]]
then icon_file="$WH_IMAGE_PATH/$3.png"
else icon_file="wine"
icon_arg="$3"
desktop_filename_arg="$4"
# Определяем имя desktop-файла
if [[ -n "$desktop_filename_arg" ]] && [[ "$desktop_filename_arg" != "nocopy" ]]; then
desktop_filename="$desktop_filename_arg"
else
desktop_filename="$(basename "$exe_file" .exe | sed "s| |_|g")"
fi
# Проверяем обязательные аргументы и наличие exe-файла
if [[ -z "$name_desktop" ]] || [[ -z "$exe_file" ]] ; then
fatal "Used: $SCRIPT_NAME --desktop \"desktop_name\" \"path_to_exe\" \"name_png_from_image\""
fatal "Использование: $0 desktop \"Имя ярлыка\" \"/путь/к/файлу.exe\" [иконка|auto] [имя_desktop_файла]"
elif [[ ! -f "$exe_file" ]] ; then
print_warning "Для создания ярлыка не найден исполняемый файл: $exe_file"
BASENAME_EXE="$(basename "$exe_file")"
local BASENAME_EXE="$(basename "$exe_file")"
print_info "Запускаем поиск $BASENAME_EXE"
local FIND_PATH
if [[ -z "$DRIVE_C" ]] || [[ ! -d "$DRIVE_C" ]]
then FIND_PATH="$WH_PREFIXES_DIR"
else FIND_PATH="$DRIVE_C"
@@ -575,11 +553,57 @@ create_desktop () {
-iname "$BASENAME_EXE")"
if [[ -z "$exe_file" ]] || [[ ! -f "$exe_file" ]]
then fatal "Для создания ярлыка не найден исполняемый файл: $BASENAME_EXE"
else print_ok "Исполняемый файл $BASENAME_EXE найден по пути $(dirname "$exe_file")/"
else print_ok "Исполняемый файл $BASENAME_EXE найден по пути: $(dirname "$exe_file")/"
fi
fi
# создаем .desktop файл
find_prefix "$exe_file"
# --- Логика обработки иконки ---
local user_icons_dir="$WINEPREFIX/icons"
create_new_dir "$user_icons_dir"
# Случай 1: Восстановление из бэкапа (передан явный путь)
if [[ "$RESTORE_FROM_BACKUP" == "1" ]] && [[ -f "$icon_arg" ]]; then
icon_file="$icon_arg"
# Случай 2: 'auto' или пустой аргумент - пытаемся извлечь из EXE
elif [[ -z "$icon_arg" ]] || [[ "$icon_arg" == "auto" ]]; then
print_info "Попытка извлечь иконку из $exe_file..."
local png_name="$(basename "$exe_file" .exe).png"
local extracted_icon_path="$user_icons_dir/$png_name"
# Проверяем, существует ли иконка, чтобы избежать повторного извлечения
if [[ -f "$extracted_icon_path" ]]; then
print_info "Иконка уже существует: $extracted_icon_path"
icon_file="$extracted_icon_path"
else
local tmp_ico_dir="$WH_TMP_DIR/icons_$$" # Используем PID для временного каталога
create_new_dir "$tmp_ico_dir"
local ico_name="$(basename "$exe_file" .exe).ico"
if wrestool -x -t 14 "$exe_file" -o "$tmp_ico_dir/$ico_name" &>/dev/null && \
icotool -x -i 1 "$tmp_ico_dir/$ico_name" -o "$tmp_ico_dir/$png_name" &>/dev/null && \
try_copy_file "$tmp_ico_dir/$png_name" "$user_icons_dir/"; then
icon_file="$extracted_icon_path"
print_ok "Иконка успешно извлечена и сохранена: $icon_file"
else
print_warning "Не удалось извлечь иконку из $exe_file. Используется иконка по умолчанию."
icon_file="wine" # Запасной вариант
fi
try_remove_dir "$tmp_ico_dir"
fi
# Случай 3: Передано конкретное имя иконки
elif [[ -f "$WH_IMAGE_PATH/$icon_arg.png" ]]; then
icon_file="$WH_IMAGE_PATH/$icon_arg.png"
# Случай 4: Запасной вариант по умолчанию
else
print_info "Иконка '$icon_arg' не найдена. Используется иконка по умолчанию."
icon_file="wine"
fi
# --- Конец логики обработки иконки ---
# Создаем .desktop файл
create_new_dir "$WH_MENU_DIR"
{
echo "[Desktop Entry]"
@@ -596,19 +620,29 @@ create_desktop () {
cp -f "$USER_WORK_PATH/$desktop_filename.desktop" "$WH_MENU_DIR/"
if [[ "$RESTORE_FROM_BACKUP" == "1" ]] ; then
print_info "Пропускаем обновление desktop.list (режим восстановления из бэкапа)"
print_info "Пропускаем обновление desktop.list (режим восстановления)"
else
# добавляем информацию о приложении в "$WINEPREFIX/desktop.list"
# Добавляем информацию о приложении в "$WINEPREFIX/desktop.list"
if [[ -f "$WINEPREFIX/desktop.list" ]] \
&& grep -qe "^${name_desktop}=" "$WINEPREFIX/desktop.list"
then sed -i "/^$name_desktop=/d" "$WINEPREFIX/desktop.list"
fi
create_new_dir "$WINEPREFIX/icons"
try_copy_file "$icon_file" "$WINEPREFIX/icons/"
echo "$name_desktop=${exe_file//$WINEPREFIX/}=$(basename "$icon_file")" >> "$WINEPREFIX/desktop.list"
# Копируем финальную иконку в директорию иконок префикса, если ее там нет
local final_icon_name
if [[ -f "$icon_file" ]]; then
final_icon_name=$(basename "$icon_file")
if [[ ! -f "$user_icons_dir/$final_icon_name" ]]; then
try_copy_file "$icon_file" "$user_icons_dir/"
fi
else
final_icon_name="$icon_file" # например, "wine"
fi
echo "$name_desktop=${exe_file//$WINEPREFIX/}=${final_icon_name}" >> "$WINEPREFIX/desktop.list"
fi
# создаем файл категории для меню
# Создаем файл категории для меню
create_new_dir "$HOME/.local/share/desktop-directories"
if [[ ! -f "$WH_MENU_CATEGORY" ]] ; then
cat > "$WH_MENU_CATEGORY" <<EOF
@@ -619,7 +653,7 @@ Icon=wine
EOF
fi
# Создаем файл меню для всех приложений
# Создаем файл меню для всех приложений WineHelper
create_new_dir "$HOME/.config/menus/applications-merged"
if [[ ! -f "$WH_MENU_CONFIG" ]] ; then
cat > "$WH_MENU_CONFIG" <<EOF
@@ -638,15 +672,15 @@ EOF
EOF
fi
# Обновляем кэш desktop файлов
# Обновляем кэш desktop-файлов
update-desktop-database "$HOME/.local/share/applications"
if [[ $4 != "nocopy" ]] ; then
if [[ "$desktop_filename_arg" != "nocopy" ]] ; then
desktop_path="$(xdg-user-dir DESKTOP)"
print_info "В меню и на рабочем столе создан $desktop_filename.desktop"
print_info "В меню и на рабочем столе создан ярлык: $desktop_filename.desktop"
cp -f "$USER_WORK_PATH/$desktop_filename.desktop" "$desktop_path"
else
print_info "В меню создан $desktop_filename.desktop"
print_info "В меню создан ярлык: $desktop_filename.desktop"
fi
if [[ -n "$INSTALL_SCRIPT_NAME" ]] \
@@ -742,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
@@ -755,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
@@ -769,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
@@ -779,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
@@ -792,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
@@ -811,10 +847,20 @@ init_wine_ver () {
export WINEDIR="$WH_DIST_DIR/$WH_WINE_USE"
if [[ ! -d "$WINEDIR" ]] ; then
local wine_package="$WH_TMP_DIR/$WH_WINE_USE.tar.xz"
try_download "$CLOUD_URL/$WH_WINE_USE.tar.xz" "$wine_package" check256sum
local download_url wine_package
download_url="$CLOUD_URL/$WH_WINE_USE.tar.xz"
wine_package="$WH_TMP_DIR/$WH_WINE_USE.tar.xz"
try_download "$download_url" "$wine_package" "check256sum"
unpack "$wine_package" "$WH_DIST_DIR/"
try_remove_file "$wine_package"
# Управление структурой подкаталога Proton "files", перемещая содержимое вверх
if [[ -d "$WINEDIR/files" ]]; then
print_info "Обнаружена структура каталогов Proton, исправляем пути..."
mv "$WINEDIR"/files/* "$WINEDIR/"
rmdir "$WINEDIR/files"
fi
fi
[[ ! -f "$WINEDIR/version" ]] && echo "$WH_WINE_USE" > "$WINEDIR/version"
@@ -1465,6 +1511,236 @@ remove_prefix() {
fi
}
select_wine_version() {
local sha256_file="$DATA_PATH/sha256sum.list"
[[ ! -f "$sha256_file" ]] && fatal "Файл с версиями WINE/Proton не найден: $sha256_file"
if [[ "$WINEARCH" == "win64" ]]; then
print_info "Фильтруем версии для 64-битного префикса..."
else # win32
print_info "Фильтруем версии для 32-битного префикса..."
fi
local options=()
local total_versions_found=0
# --- System ---
local system_wine_display_name="system"
if command -v wine &>/dev/null; then
local system_wine_version
system_wine_version=$(wine --version 2>/dev/null)
[[ -n "$system_wine_version" ]] && system_wine_display_name="$system_wine_version"
fi
options+=("--- System ---")
options+=("$system_wine_display_name")
# --- Other versions from sha256sum.list ---
local current_group=""
local group_versions=()
flush_group() {
if [[ ${#group_versions[@]} -gt 0 ]]; then
IFS=$'\n' sorted_versions=($(sort -Vr <<<"${group_versions[*]}"))
unset IFS
options+=("${sorted_versions[@]}")
((total_versions_found+=${#group_versions[@]}))
group_versions=()
fi
}
while IFS= read -r line; do
if [[ "$line" =~ ^#+[[:space:]]([^#[:space:]]+)[[:space:]]#* ]]; then
flush_group
current_group="${BASH_REMATCH[1]}"
# Отображаем только группы, которые являются сборками WINE или PROTON
case "$current_group" in
WINE|WINE_LG|PROTON_LG|PROTON_STEAM)
local pretty_key=$(echo "$current_group" | tr '_' ' ' | sed -e "s/\b\(.\)/\u\1/g")
options+=("--- $pretty_key ---")
;;
*)
current_group=""
;;
esac
elif [[ -n "$current_group" ]] && [[ "$line" =~ [a-f0-9]{64} ]]; then
local filename=$(echo "$line" | awk '{print $2}')
local version_name=${filename%.tar.xz}
if [[ "$WINEARCH" == "win64" ]]; then
if [[ "$version_name" =~ (amd64|x86_64|wow64) ]] || ! [[ "$version_name" =~ i[3-6]86 ]]; then
group_versions+=("$version_name")
fi
else # win32
group_versions+=("$version_name")
fi
fi
done < "$sha256_file"
flush_group
if [[ $total_versions_found -eq 0 ]]; then
print_warning "Не найдено подходящих версий WINE/Proton для архитектуры $WINEARCH."
print_warning "Будет использована версия по умолчанию: $WH_WINE_USE"
return
fi
local selectable_options=("Отмена")
local display_groups=()
local current_group_items=()
local choice_idx=0
flush_current_group() {
if ((${#current_group_items[@]} > 0)); then
# Объединяйте элементы с помощью уникального разделителя для последующего разделения
display_groups+=("$(IFS='@@@'; echo "${current_group_items[*]}")")
current_group_items=()
fi
}
current_group_items+=(" 0) Отмена создания префикса")
for opt in "${options[@]}"; do
if [[ "$opt" == "---"* ]]; then
flush_current_group
display_groups+=("$opt")
else
((choice_idx++))
current_group_items+=(" ${choice_idx}) $opt")
selectable_options+=("$opt")
fi
done
flush_current_group # Очистка последней группы
print_info "Выберите версию WINE/Proton для $WINEARCH префикса:"
local first_block=true
for group_data in "${display_groups[@]}"; do
if [[ "$group_data" == "---"* ]]; then
if [[ "$first_block" = false ]]; then
echo
fi
echo "$group_data"
else
local items_to_print=()
IFS='@@@' read -r -a items_to_print <<< "$group_data"
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]}"
done
echo
done
fi
first_block=false
done
while true; do
echo
local max_choice=$(( ${#selectable_options[@]} - 1 ))
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
fi
local selected_opt
selected_opt="${selectable_options[$user_choice]}"
if [[ "$selected_opt" == "$system_wine_display_name" ]]; then
export WH_WINE_USE="system"
else
export WH_WINE_USE="$selected_opt"
fi
break
else
print_error "Неверный выбор. Введите число от 0 до $max_choice."
fi
done
}
create_prefix() {
print_info "Существующие префиксы:"
local prefixes=()
for prefix in "$WH_PREFIXES_DIR"/*; do
if [[ -d "$prefix" ]] ; then
prefixes+=("$(basename "$prefix")")
echo " - $(basename "$prefix")"
fi
done
if [[ ${#prefixes[@]} -eq 0 ]]; then
print_info "Нет существующих префиксов."
fi
echo
read -p "Введите имя для нового префикса или 0 для отмены (по умолчанию: default): " prefix_name
if [[ "$prefix_name" == "0" ]] ; then
print_info "Создание префикса отменено."
exit 0
fi
prefix_name=${prefix_name:-default}
if [[ ! "$prefix_name" =~ ^[a-zA-Z0-9_.-]+$ ]] ; then
fatal "Имя префикса может содержать только латинские буквы, цифры, точки, дефисы и подчеркивания"
fi
if [[ -d "$WH_PREFIXES_DIR/$prefix_name" ]] ; then
fatal "Префикс с именем '$prefix_name' уже существует. Создание отменено."
fi
print_info "Создается префикс с именем: \"$prefix_name\""
print_info "Выберите разрядность префикса:"
echo " 0) Отмена создания префикса"
echo " 1) 32-bit"
echo " 2) 64-bit"
echo
local arch_choice
read -p "Ваш выбор [0-2] (по умолчанию 1): " arch_choice
case "${arch_choice:-1}" in
0) print_info "Создание префикса отменено." ; exit 0 ;;
1) export WINEARCH="win32" ;;
2) export WINEARCH="win64" ;;
*) fatal "Неверный выбор. Операция отменена." ;;
esac
select_wine_version
print_info "Выберите тип создаваемого префикса:"
echo " 0) Отмена создания префикса"
echo " 1) Чистый префикс (без библиотек)"
echo " 2) С рекомендуемыми библиотеками"
echo
local pfx_type_choice
read -p "Ваш выбор [0-2] (по умолчанию 1): " pfx_type_choice
case "${pfx_type_choice:-1}" in
0) print_info "Создание префикса отменено." ; exit 0 ;;
1) export BASE_PFX="none" ;;
2) ;; # Оставляем BASE_PFX пустым, чтобы init_wineprefix использовал значение по умолчанию
*) fatal "Неверный выбор. Операция отменена." ;;
esac
export WINEPREFIX="$WH_PREFIXES_DIR/$prefix_name"
if ! init_wine_ver || ! init_wineprefix; then
fatal "Ошибка инициализации префикса."
fi
print_ok "Префикс '$prefix_name' (${WINEARCH}) успешно создан."
}
remove_winehelper () {
local answer
if [[ $1 =~ --force|-y ]] ; then
@@ -1737,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 [команда]
@@ -1745,9 +2179,13 @@ wh_info () {
install [скрипт] запустить скрипт установки программы
install [скрипт] --clear-pfx не использовать готовый префикс для установки ПО
install-dxvk [версия|none|list] установить, удалить или показать версии DXVK
install-vkd3d [версия|none|list] установить, удалить или показать версии VKD3D
installed список установленных программ
run [программа] запуск программы (отладка)
remove-all удалить WineHelper и все связанные данные
create-prefix создать префикс
remove-prefix [имя_префикса] удалить префикс и все связанные данные
backup-prefix [имя_префикса] создать резервную копию префикса
restore-prefix \"путь/до/whpack\" восстановить префикс из резервной копии
@@ -1791,17 +2229,22 @@ 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 "$@" ;;
restore-prefix) restore_prefix "$@" ;;
remove-all) remove_winehelper "$@" ;;
create-prefix) create_prefix "$@" ;;
remove-prefix) remove_prefix "$@" ;;
create-base-pfx) create_base_pfx "$@" ;;
init-prefix) prepair_wine ; wait_wineserver ;;
*)
if [[ -f "$arg1" ]] ; then
WIN_FILE_EXEC="$(readlink -f "$arg1")"
WIN_FILE_NAME="$(basename "$arg1")"
WIN_FILE_NAME="$(basename "$WIN_FILE_EXEC")"
find_prefix "$WIN_FILE_EXEC"
case "${WIN_FILE_NAME,,}" in
*.exe) prepair_wine ; wine_run $WINE_WIN_START "$WIN_FILE_EXEC" "$@" ;;
*.msi) prepair_wine ; wine_run msiexec /i "$WIN_FILE_EXEC" "$@" ;;

File diff suppressed because it is too large Load Diff