#!/usr/bin/env bash
# info_ru: Таможенное законодательство
########################################################################
export WH_WINE_USE="wine_x_tkg_10-0_amd64"
export WINEPREFIX="alta"
export PROG_NAME="Таможенные документы"
export PROG_ICON="altatamdoc"
export BASE_PFX="alta_pfx_x86_v01"
export WH_WINDOWS_VER="10"
export WINEARCH="win32"
export INSTALL_DLL="corefonts eufonts lucida opensymbol tahoma cjkfonts vb6run mdac28 msxml3 msxml4 msxml6 mfc42 jet40 native_oleaut32"

AUTOINSTALL_EXE="${WH_TMP_DIR}/ordw030225.zip"
AUTOINSTALL_UNPACK="${WH_TMP_DIR}/ordw030225"
AUTOINSTALL_SETUP="${WH_TMP_DIR}/ordw030225/setup.exe"

prepair_wine
if try_download "https://www2.alta.ru/pub/packets/distr/ordw030225.zip" "${AUTOINSTALL_EXE}" ; then
    7z x -y "${AUTOINSTALL_EXE}" -o"${AUTOINSTALL_UNPACK}"
    try_remove_file "$AUTOINSTALL_EXE"

    wine_run_install "${AUTOINSTALL_SETUP}" /S /OVERWRITE
    try_remove_dir "$AUTOINSTALL_UNPACK"

    WIN_FILE_EXEC="$DRIVE_C/ALTA/ordview.exe"
    create_desktop "$PROG_NAME" "$WIN_FILE_EXEC" "$PROG_ICON"
fi
