# ===================================================================================================
# Installation
# ===================================================================================================

# Load Variables
 SF-LoadVariables "%c_ConfigPath%\%_PkgCFGName%.cfg" "CommonClientSettings"

# Check Config Variables
 If ((SF-Variables "%_VarPrefix-Store0%") -eq ""){
    SF-Exit "Value for Variable <Store0> must be set in %_PkgCFGName%.cfg"  
 } 

# Terminate Tasks
 SF-Taskkill "%_ProgramFiles32%\Citrix\ICA Client"

# Check if Installed
 If ((SF-File "%_CommonApplicationData%\Citrix\Citrix Receiver\TrolleyExpress.exe") -eq $True){
    SF-Run "%_CommonApplicationData%\Citrix\Citrix Receiver\TrolleyExpress.exe" "/uninstall /cleanup /silent" -Wait -NoErrors
 }

# Installation
 SF-Run "%_PkgSource%\Setup\CitrixReceiver.exe" "/includeSSON /silent /noreboot ALLOWSAVEPWD=A STORE0=""%_VarPrefix-Store0%""" -Wait

# Fix - Damit die Fenster auch immer im Vollbild aufgehen
 SF-Register32 'HKEY_LOCAL_MACHINE' 'SOFTWARE\Citrix\ICA Client\Engine\Configuration\Advanced\Modules\WFClient' 'TWISeamlessFlag' '1' 'REG_SZ'

# ===================================================================================================
# END
# ===================================================================================================