#!/usr/bin/env bash
# info_ru: (Сервер) Локальный корпоративный чат/мессенджер с поддержкой видеоконференций.
########################################################################
export WH_WINE_USE="wine_x_tkg_10-0_amd64"
export WINEPREFIX="commfort"
export PROG_NAME="CommFort server"
export PROG_ICON="commfort-server"
export WH_WINDOWS_VER="10"
export WINEARCH="win32"

PACKZIP="${WH_TMP_DIR}/commfort_server.zip"
AUTOINSTALL_UNPACK="${WH_TMP_DIR}/commfort_server"
AUTOINSTALL_EXE="${WH_TMP_DIR}/commfort_server/commfort_server_599.exe"

prepair_wine
if try_download "https://www.commfort.com/download/commfort_server.zip" "${PACKZIP}" ; then
    unpack "${PACKZIP}" "$AUTOINSTALL_UNPACK"
    wine_run_install "$AUTOINSTALL_EXE" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
    try_remove_file "$PACKZIP"
    try_remove_dir "$AUTOINSTALL_UNPACK"

    WIN_FILE_EXEC="$DRIVE_C/Program Files/CommFort_server/CommFort_server.exe"
    create_desktop "$PROG_NAME" "$WIN_FILE_EXEC" "$PROG_ICON"
fi
