The forum

[Script] Alcoma ASD Client 9.1

Service utility for Alcoma radio devices

Author Replies
jbubik Thursday 16 May 2013 at 20:32
jbubikAnonymous

Alcoma a.s. is a Czech engineering company and a manufacturer of quality backhaul and lastmile radio relay systems. Their radio devices are managed by Alcoma ASD Client - a small windows program available on their website. It is a commercial program that needs a licence file to work. Such a licence file is available to Alcoma customers only. ASD Client can communicate with the radio device over TCP/IP or via serial cable (requires COM port or USB2COM cable).

This PoL script downloads a ZIP file with the program and unzips it. It takes special care to setup WINE correctly for serial port. It also copies the users licence over to the program directory. The only dependency is the command "unzip" for extracting the files. Otherwise it should be pretty portable. The screenshots are a little boring as there is nothing to see in a service utility such as ASD. Please try it and recommend for signature :-)

#!/bin/bash
# Date : (2013-05-14 22-45)
# Last revision : (2013-05-16 20-28)
# Wine version used : 1.2.2 and 1.4
# Distribution used to test : Ubuntu 10.04 LTS, Ubuntu 10.10, Ubuntu 12.04 LTS
# Author : jbubik
# Script licence : GPL
# Program licence : commercial software / free to use for holders of Alcoma licence file
# Depend : unzip
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
TITLE="Alcoma ASD Client 9.1"
PREFIX="ASD91"
PROGDIR="$REPERTOIRE/wineprefix/$PREFIX/drive_c/Program Files/ASD/"
#Initialization
POL_SetupWindow_Init
POL_Debug_Init
# Presentation
POL_SetupWindow_presentation "$TITLE" "ALCOMA a.s." "http://www.alcoma.com" "jbubik" "$PREFIX"
# Create Prefix
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate
POL_System_TmpCreate "$PREFIX"
cd "$POL_System_TmpDir"
#download a ZIP file from vendor
POL_Download "http://www.alcoma.cz/upload/download/ASD9.1_virtualni_systemy.zip" "a3022fe53c6cae9e2540c8e60d4e48b1"
[ -f ASD9.1_virtualni_systemy.zip ] || POL_Debug_Fatal "$(eval_gettext 'An error happened during download.')"
#unzip the archive
POL_SetupWindow_wait "$(eval_gettext 'Unzipping downloaded files. Please wait.')" "$TITLE"
mkdir -p "$PROGDIR"
cd "$PROGDIR"
unzip "$POL_System_TmpDir/ASD9.1_virtualni_systemy.zip"
#select the licence file and copy it to program directory
POL_SetupWindow_browse "$(eval_gettext 'You need a licence file to use $TITLE. Please select the file now!')" "$TITLE" "licence.key"
[ -f "$APP_ANSWER" ] && cp "$APP_ANSWER" "$PROGDIR/licence.key"
#configure WINE to use specific COM port
POL_SetupWindow_menu "$(eval_gettext 'Select the COM port to use for direct communication with the device:')" \\
                     "$TITLE" "none|/dev/ttyS0|/dev/ttyS1|/dev/ttyUSB0|/dev/ttyUSB1" "|"
if [ "$APP_ANSWER" != "none" ] ; then
  COMDEVICE="$REPERTOIRE/wineprefix/$PREFIX/dosdevices/com1"
  ln -s "$APP_ANSWER" "$COMDEVICE"
  [ -w "$APP_ANSWER" ] || POL_SetupWindow_message "$(eval_gettext 'Symbolic link created for COM1 in $COMDEVICE\\n\\nWARNING: it seems that COM port either does not exist or is not accessible for this user.\\nPlease correct the symlink or permissions before using $TITLE.')" "$TITLE"
fi
#configure WINE registry for COM port enumeration - taken from WineBug #4282
cat << EOF >> "$REPERTOIRE/wineprefix/$PREFIX/system.reg"
[Hardware\\\\\\\\Devicemap\\\\\\\\SerialComm]
"Serial0"="COM1"
EOF
#notify user to copy his specific radio channel tables to ASD
POL_SetupWindow_message "$(eval_gettext 'Please manually copy channel table files to program directory:\\n$PROGDIR\\n\\nInstallation complete.')" "$TITLE"
# Create Shortcuts
POL_Shortcut "asdclient.exe" "$TITLE"
#Finish
POL_System_TmpDelete
POL_SetupWindow_Close
exit 0


Screenshots:
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/asd-screenshot1.png
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/asd-screenshot2.png
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/asd-screenshot3.png

Icons:
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/alcoma_asd-48x48.png
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/alcoma_asd-22x22.png
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/left.png
https://dl.dropboxusercontent.com/u/50123652/PlayOnLinux/Alcoma_ASD/top.png

petch Thursday 16 May 2013 at 22:43
petch

HI jbubik,
Not much to say about your script, only two remarks:
[ -f ASD9.1_virtualni_systemy.zip ] || POL_Debug_Fatal "$(eval_gettext 'An error happened during download.')"

Shouldn't be strictly necessary, POL_Download should raise an error if the file doesn't pass the hash check, that it cannot pass if it doesn't exist ;)

#configure WINE registry for COM port enumeration - taken from WineBug #4282
...

That may have been "ok" in 2006, but is a no go today; Create a separate .reg file somewhere in the temp directory and register its content into the system registry using POL_Wine regedit.
They're lots of examples around, but to give just one: http://www.playonmac.com/en/source-1016-GOGcom__Ground_Control_2.html

# Remove the "beta DirectX version" warning upon first run
cat <<_EOFREG_ > "$POL_USER_ROOT/tmp/dxtested.reg"
[HKEY_LOCAL_MACHINE\\Software\\Massive Entertainment AB\\Ground Control II]
"HardwareChecks"=dword:00000010
"HardwareCheckVersion"=dword:00000009
_EOFREG_
POL_Wine regedit "$POL_USER_ROOT/tmp/dxtested.reg"
rm "$POL_USER_ROOT/tmp/dxtested.reg"


After those fixes (specially the second one) I think you can submit it into the repository for signing (not sure in which category though).

Regards,
Pierre.

Edited by petch