diff --git a/winehelper b/winehelper index 3d0c442..1180269 100755 --- a/winehelper +++ b/winehelper @@ -369,8 +369,24 @@ create_desktop () { if [[ -z "$name_desktop" ]] || [[ -z "$exe_file" ]] ; then fatal "Used: $SCRIPT_NAME --desktop \"desktop_name\" \"path_to_exe\" \"name_png_from_image\"" + elif [[ ! -f "$exe_file" ]] ; then + print_warning "Для создания ярлыка не найден исполняемый файл: $exe_file" + + BASENAME_EXE="$(basename "$exe_file")" + print_info "Запускаем поиск $BASENAME_EXE" + if [[ -z "$DRIVE_C" ]] || [[ ! -d "$DRIVE_C" ]] + then FIND_PATH="$WH_PREFIXES_DIR" + else FIND_PATH="$DRIVE_C" + fi + exe_file="$(find "$FIND_PATH" -type f -not -type l \ + -not -path "*/windows/*" -not -path "*/dosdevices/*" \ + -iname "$BASENAME_EXE")" + if [[ -z "$exe_file" ]] || [[ ! -f "$exe_file" ]] + then fatal "Для создания ярлыка не найден исполняемый файл: $BASENAME_EXE" + else print_ok "Исполняемый файл $BASENAME_EXE найден по пути $(dirname "$exe_file")/" + fi fi - [[ ! -f "$exe_file" ]] && fatal "Для создания ярлыка не найден исполняемый файл: $exe_file" + [[ ! -f "$icon_file" ]] && icon_file=wine { @@ -712,7 +728,6 @@ init_wineprefix () { try_remove_file "$DRIVE_C/windows/system32/winemenubuilder.exe" } - update_winetricks () { W_TRX_URL="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" W_TRX_EXT_VER="$(curl -s --list-only "$W_TRX_URL" | grep -i 'WINETRICKS_VERSION=' | sed 's/WINETRICKS_VERSION=//')"