#!/bin/sh -e
# this script is gonna be replaced by vmware's wrapper
# when vmware view client bundle is actually installed

. userinstall-sh-functions

icon="vmware-view"

if [ "$(uname -m)" = "x86_64" ]; then
    # 64-bit client
    url='https://download3.vmware.com/software/view/viewclients/CART20FQ4/VMware-Horizon-Client-5.3.0-15208949.x64.bundle'
    download_url='https://my.vmware.com/web/vmware/details?downloadGroup=CART20FQ4_LIN64_530&amp;productId=863'
else
    # 32-bit client
    url='https://download3.vmware.com/software/view/viewclients/CART20FQ4/VMware-Horizon-Client-5.3.0-15208949.x86.bundle'
    download_url='https://my.vmware.com/web/vmware/details?downloadGroup=CART20FQ4_LIN32_530&amp;productId=863'
fi

_init_

oktogo() { _oktogo "Загрузить <a href=\"$download_url\" title=\"Сайт поставщика\">клиент VMware View</a> и установить?"; }

run() { sudo userinstall-helper --run "$outfile"; }

failed() { _failed 'Не удалось установить клиент VMware View, <a href="http://altlinux.org/vmware-view" title="ALT Linux Wiki">попробуйте сами</a> от имени <b>root</b>.'; }

oktogo && download && run || failed

vmware-view "$@"
