#!/usr/bin/env bash
# info_ru: Справочник кодов обозначения налоговых органов для целей учета налогоплательщиков
########################################################################
export AUTOINSTALL_EXE="${WH_TMP_DIR}/soun_ins.exe"
export WH_WINE_USE="wine_x_tkg_10-0_amd64"
export WINEPREFIX="soun"
export PROG_NAME="СОУН"
# export PROG_VERSION=""
export PROG_ICON="soun"
# export ADD_MIME_TYPE=""
export BASE_PFX="defpfx_x86_v01"
export WINEARCH="win32"
export INSTALL_DLL="corefonts"
export WH_WINDOWS_VER="10"

prepair_wine
if try_download "https://data.nalog.ru/files/Soun/2.6.2/soun_ins.exe" "${AUTOINSTALL_EXE}" ; then
    # TODO: Тихий режим или предупреждение
    wine_run_install "${AUTOINSTALL_EXE}"
    try_remove_file "${AUTOINSTALL_EXE}"

    WIN_FILE_EXEC="$DRIVE_C/СОУН/SOUN.EXE"
    create_desktop "$PROG_NAME" "$WIN_FILE_EXEC" "$PROG_ICON"
fi
