Compare commits

..

4 Commits

Author SHA1 Message Date
Sergey Palcheh
a5e396eead (gui): fix security and stability issues
- add null-safety for path variables (USER_WORK_PATH, DATA_PATH)
- fix potential crash in handle_process_output with uninitialized process
- improve env vars and executable path handling
- enhance .desktop files and menu processing
2026-01-22 18:03:04 +06:00
Sergey Palcheh
3e18a73383 (gui): improved error handling 2026-01-22 16:56:24 +06:00
Sergey Palcheh
2a5003c15b (gui): adding type annotations 2026-01-22 14:36:46 +06:00
Sergey Palcheh
10ca3b3c98 refactor(gui): unification of team dialogues via _create_command_dialog()
Refactored 5 methods:
- run_prefix_installer;
- run_update_associations_command;
- create_launcher_for_prefix;
- backup_prefix_for_app;
- restore_prefix.
2026-01-21 19:41:00 +06:00
2 changed files with 803 additions and 470 deletions

View File

@@ -138,7 +138,7 @@ check_variables WINEFSYNC "0"
check_variables WINEUSERNAME "xuser"
check_variables WINEARCH "win64" # or "win32"
check_variables WH_WINE_USE "wine-10.18.1-alt1-wow64" # or system
check_variables WH_WINE_USE "wine_x_tkg_10-0_amd64" # or system
check_variables WH_USE_CPCSP_PROXY "0"
check_variables CPCSP_PROXY_X86_64_VER "0.6.1-alt1"
@@ -1151,7 +1151,10 @@ check_prefix_var () {
init_wineprefix () {
check_prefix_var
check_variables BASE_PFX "none"
if [[ "$WINEARCH" == "win32" ]]
then check_variables BASE_PFX "defpfx_x86_v01"
else check_variables BASE_PFX "defpfx_x64_v01"
fi
export DRIVE_C="$WINEPREFIX/drive_c"
export XUSER_PATH="$DRIVE_C/users/xuser"
@@ -1195,7 +1198,7 @@ init_wineprefix () {
if [[ ! -d "$WINEPREFIX/dosdevices" ]] ; then
create_new_dir "$WINEPREFIX/dosdevices"
export REBOOT_PFX="1"
local run_wbr="1"
fi
if [[ ! -d "${WINEPREFIX}/dosdevices/c:" ]] ; then
@@ -1208,9 +1211,10 @@ init_wineprefix () {
try_force_link_dir "$HOME" "${WINEPREFIX}/dosdevices/h:"
fi
if [[ $REBOOT_PFX == "1" ]] ; then
if [[ $run_wbr == "1" ]] ; then
"$WINELOADER" wineboot -r
wait_wineserver
unset run_wbr
fi
if [[ -f "$WINEPREFIX/system.reg" ]] \
@@ -1367,9 +1371,7 @@ init_wineprefix () {
fi
fi
if ! grep -q "cpcsp_proxy.dll" "$WINEPREFIX/system.reg" \
|| [[ $REBOOT_PFX == "1" ]]
then
if ! grep -q "cpcsp_proxy.dll" "$WINEPREFIX/system.reg" ; then
print_info "Запускаем настройку cpcsp_proxy..."
CPCSP_PROXY_OK="0"
@@ -1442,8 +1444,6 @@ init_wineprefix () {
do
echo "export $var=\"${!var}\"" >> "$WINEPREFIX/last.conf"
done
unset REBOOT_PFX
}
kill_autostart () {
@@ -1566,7 +1566,7 @@ wine_regfile () {
wine_run () {
local wh_add_args win_file_exec win_file_path win_file_name
if [[ $1 =~ (winecfg|regedit|winefile|wineconsole|control) ]] ; then
if [[ $1 =~ (winecfg|regedit|winefile|wineconsole) ]] ; then
win_file_exec="$1"
win_file_name="$win_file_exec"
win_file_path="$DRIVE_C"
@@ -1616,9 +1616,9 @@ wine_run () {
| grep -v "ICON" | sort | tee -a "$log_file"
echo -e "\n##### Лог WINE #####" | tee -a "$log_file"
$MANGOHUD_RUN "$WINELOADER" $wh_add_args "$win_file_exec" "$@" 2>&1 | tee -a "$log_file"
$MANGOHUD_RUN "$WINELOADER" $wh_add_args "$win_file_exec" "$@" $LAUNCH_PARAMETERS 2>&1 | tee -a "$log_file"
else
$MANGOHUD_RUN "$WINELOADER" $wh_add_args "$win_file_exec" "$@"
$MANGOHUD_RUN "$WINELOADER" $wh_add_args "$win_file_exec" "$@" $LAUNCH_PARAMETERS
fi
wait_wineserver
@@ -2628,7 +2628,6 @@ case "$arg1" in
winereg|regedit) prepair_wine ; wine_run "regedit" ;;
winefile|explorer) prepair_wine ; wine_run "winefile" ;;
wineconsole|cmd) prepair_wine ; wine_run "wineconsole" ;;
control) prepair_wine ; wine_run "control" ;;
winetricks) prepair_wine ; "$WH_WINETRICKS" -q "$@" ;;
desktop) create_desktop "$@" ; exit 0 ;;
install|-i) run_autoinstall "$@" ;;
@@ -2663,16 +2662,15 @@ case "$arg1" in
if [[ -n "$1" ]] && [[ -f "$1" ]] ; then
WIN_OPEN_FILE="$("$WINELOADER" winepath -w "$1")"
shift
wine_run "$WIN_FILE_EXEC" "$@" "$WIN_OPEN_FILE"
else
wine_run "$WIN_FILE_EXEC" "$@"
fi
wine_run "$WIN_FILE_EXEC" "$@" "$WIN_OPEN_FILE"
else
print_error "Команды $arg1 не существует."
wh_info
exit 1
fi
;;
;;
esac
if [[ -n "$WH_BG_PID" ]] ; then

File diff suppressed because it is too large Load Diff