forked from CastroFidel/winehelper
Compare commits
12 Commits
abc_progra
...
0.4.6
Author | SHA1 | Date | |
---|---|---|---|
9acef3c065 | |||
206e6f5467 | |||
973ae4c61a | |||
30cab1f4d1 | |||
6374e30797 | |||
a1500e320b | |||
5af77fee07 | |||
8e96de0626 | |||
a2b12327d4 | |||
b00702c77f | |||
74d8facc08 | |||
0fa3e567ba |
@ -1,5 +1,8 @@
|
||||
История изменений:
|
||||
|
||||
0.4.6:
|
||||
* добавлено автодопонение команд для bash (bash_completion)
|
||||
|
||||
0.4.5:
|
||||
* скорректирована проверка синтаксиса скриптов
|
||||
|
||||
|
42
auto_completion/bash_completion/winehelper
Normal file
42
auto_completion/bash_completion/winehelper
Normal file
@ -0,0 +1,42 @@
|
||||
# Auto-completion for winhelper
|
||||
_winehelper_completions() {
|
||||
local cur prev opts
|
||||
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"
|
||||
wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run"
|
||||
|
||||
case "${prev}" in
|
||||
winehelper)
|
||||
COMPREPLY=( $(compgen -W "${opts} ${wine_cmd}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
--debug)
|
||||
COMPREPLY=( $(compgen -W "${wine_cmd}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
install|-i)
|
||||
local scripts="$(ls -1 /usr/share/winehelper/autoinstall) $(ls -1 /usr/share/winehelper/manualinstall)"
|
||||
COMPREPLY=( $(compgen -W "list ${scripts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
run|installed)
|
||||
local installed=$(grep -h "Exec=env" ~/.local/share/winehelper/*.desktop 2>/dev/null | awk -F'/' '{print $NF}' | awk -F'"' '{print $1}')
|
||||
COMPREPLY=( $(compgen -W "${installed}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
remove-prefix|backup-prefix)
|
||||
local prefixes=$(ls -1 ~/.local/share/winehelper/prefixes 2>/dev/null)
|
||||
COMPREPLY=( $(compgen -W "${prefixes}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
restore-prefix)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
complete -F _winehelper_completions winehelper
|
@ -10,25 +10,16 @@ export WH_WINDOWS_VER="10"
|
||||
export WINEARCH="win64"
|
||||
# export INSTALL_DLL=""
|
||||
|
||||
prepair_wine
|
||||
print_info "Загрузка страницы..."
|
||||
ABC_FILE="${WH_TMP_DIR}/abc_akkord_pos.html"
|
||||
curl -o "$ABC_FILE" -A "Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)" "https://abccenter.ru/download-ru/"
|
||||
|
||||
if [[ ! -f "$ABC_FILE" ]] \
|
||||
|| grep -q "Forbidden" "$ABC_FILE"
|
||||
then
|
||||
fatal "Страница сайта не доступна, или превышено количество запросов к странице."
|
||||
fi
|
||||
|
||||
# Возможны точки либо нижнее подчеркивание в URL-адресе
|
||||
VERDATE=$(grep -oP 'akkord_pos_\K\d+[._]\d+[._]\d+[._]\d+_\d+-\d+-\d+' "$ABC_FILE")
|
||||
try_get_page "https://abccenter.ru/download-ru/"
|
||||
VERDATE=$(read_page | grep -oP 'akkord_pos_\K\d+[._]\d+[._]\d+[._]\d+_\d+-\d+-\d+')
|
||||
AUTOINSTALL_EXE="${WH_TMP_DIR}/akkord_pos_${VERDATE}.exe"
|
||||
|
||||
prepair_wine
|
||||
|
||||
if try_download "https://abccenter.ru/wp-content/soft/akkord_pos_${VERDATE}.exe" "${AUTOINSTALL_EXE}" ; then
|
||||
wine_run_install "${AUTOINSTALL_EXE}" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
|
||||
try_remove_file "$AUTOINSTALL_EXE"
|
||||
try_remove_file "$ABC_FILE"
|
||||
|
||||
WIN_FILE_EXEC="$DRIVE_C/ABC-Soft/AKKORD POS/ABCAKKORD.exe"
|
||||
create_desktop "$PROG_NAME" "$WIN_FILE_EXEC" "$PROG_ICON"
|
50
winehelper
50
winehelper
@ -46,11 +46,11 @@ check_variables () { [[ -z ${!1} ]] && export $1="$2" ;}
|
||||
if [[ "$1" == "--debug" ]] ; then
|
||||
check_variables WINEDEBUG "+loaddll,+seh"
|
||||
export DXVK_LOG_LEVEL="error"
|
||||
export VKD3D_DEBUG "error"
|
||||
export WINE_MONO_TRACE "E:System.NotImplementedException"
|
||||
export VK_LOADER_DEBUG "error"
|
||||
export VKBASALT_LOG_LEVEL "error"
|
||||
export DXVK_NVAPI_LOG_LEVEL "error"
|
||||
export VKD3D_DEBUG="error"
|
||||
export WINE_MONO_TRACE="E:System.NotImplementedException"
|
||||
export VK_LOADER_DEBUG="error"
|
||||
export VKBASALT_LOG_LEVEL="error"
|
||||
export DXVK_NVAPI_LOG_LEVEL="error"
|
||||
shift
|
||||
else
|
||||
check_variables WINEDEBUG "-all"
|
||||
@ -83,6 +83,7 @@ WH_IMAGE_PATH="$DATA_PATH/image"
|
||||
WH_DB_DIR="$DATA_PATH/database"
|
||||
WH_AUTOINSTALL_DIR="$DATA_PATH/autoinstall"
|
||||
WH_MANUALINSTALL_DIR="$DATA_PATH/manualinstall"
|
||||
WH_TESTINSTALL_DIR="$DATA_PATH/testinstall"
|
||||
WH_WINETRICKS="$DATA_PATH/winetricks_$WINETRICKS_VERSION"
|
||||
|
||||
WH_MENU_DIR="$HOME/.local/share/applications/WineHelper"
|
||||
@ -240,11 +241,11 @@ unpack () {
|
||||
print_info "Запуск распаковки архива $1"
|
||||
local command outarg
|
||||
case $1 in
|
||||
*.tar.xz) command="tar -Jxhf" ; outarg="-C " ;;
|
||||
*.tar.gz) command="tar -xhzf" ; outarg="-C " ;;
|
||||
*.tar.xz) command="tar -Jxhf" ; outarg="-C " ;;
|
||||
*.tar.gz) command="tar -xhzf" ; outarg="-C " ;;
|
||||
*.tar.zst) command="tar -I zstd -xhf" ; outarg="-C " ;;
|
||||
*.tar) command="tar -xhf" ; outarg="-C " ;;
|
||||
*.zip|*.exe) command="7z x -y" ; outarg="-o" ;;
|
||||
*.tar) command="tar -xhf" ; outarg="-C " ;;
|
||||
*.zip|*.exe|*.rar) command="7z x -y" ; outarg="-o" ;;
|
||||
esac
|
||||
create_new_dir "$2"
|
||||
if $command "$1" ${outarg}"$2" ; then
|
||||
@ -255,6 +256,32 @@ unpack () {
|
||||
fi
|
||||
}
|
||||
|
||||
try_get_page () {
|
||||
local url_page="$1"
|
||||
export OUT_PAGE_TMP="${WH_TMP_DIR}/url_page.tmp"
|
||||
print_info "Чтение страницы: $url_page"
|
||||
if ! curl -o "$OUT_PAGE_TMP" -A "Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)" "$url_page" \
|
||||
|| grep -q "Forbidden" "$OUT_PAGE_TMP"
|
||||
then
|
||||
try_remove_file "$OUT_PAGE_TMP"
|
||||
fatal "Страница сайта $1 не доступна, или превышено количество запросов к странице."
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
read_page () {
|
||||
if [[ -n $OUT_PAGE_TMP ]] \
|
||||
&& [[ -f "$OUT_PAGE_TMP" ]]
|
||||
then
|
||||
cat "$OUT_PAGE_TMP"
|
||||
try_remove_file "$OUT_PAGE_TMP"
|
||||
unset OUT_PAGE_TMP
|
||||
else
|
||||
echo "Исользуй try_get_page перед read_page"
|
||||
fi
|
||||
}
|
||||
|
||||
try_download () {
|
||||
local DOWNLOAD_FILE_URL="${1// /%20}"
|
||||
local OUTPUT_FILE="$2"
|
||||
@ -1208,6 +1235,11 @@ run_autoinstall () {
|
||||
elif [[ -f "$WH_MANUALINSTALL_DIR/$INSTALL_SCRIPT_NAME" ]] ; then
|
||||
INSTALL_SCRIPT="$WH_MANUALINSTALL_DIR/$INSTALL_SCRIPT_NAME"
|
||||
WH_INSTALL_MODE="manual"
|
||||
elif [[ -d "$WH_TESTINSTALL_DIR" ]] \
|
||||
&& [[ -f "$WH_TESTINSTALL_DIR/$INSTALL_SCRIPT_NAME" ]]
|
||||
then
|
||||
INSTALL_SCRIPT="$WH_TESTINSTALL_DIR/$INSTALL_SCRIPT_NAME"
|
||||
WH_INSTALL_MODE="test"
|
||||
else
|
||||
INSTALL_SCRIPT="0"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user