Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/VARA FM/credits
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Added to pi-apps by Fredrik Lundhag after using VARA HF from Eric Wiessner (KI7POL) as a template.

Special thanks: Sebastien "ptitSeb" Chevalier (box86/box64), Esme "madewokherd" Povirk (wine-mono functions),
MarcoDT (Artemis, early programming encouragement), Botspot / theofficialgman (Pi-Apps Wine installer),
everyone who's helped and inspired Winelink (OH8STN, K0SWE, KD2ROS, PE1RRR, LB4PJ, K7MHI, WH6AZ, KM4ACK, KR0SIV),
Pat team (LA5NTA, K0SWE), proof-of-concept Winlink on Linux guides (K6ETA, DCJ21), ARDOP devs (KN6KB, G8BPQ, KG4JJA),
those who got me interested in ham radio (N7ACW, AD7HE, KK6FVG), and everyone who tries to keep ham radio open source.

"My humanity is bound up in yours, for we can only be human together" - Nelson Mandela
8 changes: 8 additions & 0 deletions apps/VARA FM/description
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
A shareware FM modem for amateur radio messaging.

VARA modems require a messaging app (such as Pat, Winlink Express, VarAC, or VARAChat), an amateur radio transceiver, and cables to connect audio and PTT control from your Pi to the transceiver.

Run from Menu: Menu -> Accessories -> VARA FM
Run from Terminal: wine "C:\VARAFM\VARAFM.exe"

This app runs with the help of Box86/Box64 and Wine.
Binary file added apps/VARA FM/icon-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/VARA FM/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions apps/VARA FM/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

#Finding the latest VARA FM version from the winlink.org directory listing
version=$(wget -qO- "https://downloads.winlink.org/VARA%20Products/" \
| grep -oP 'VARA%20FM%20v[\d.]+%20+setup\.zip' \
| sort -V | tail -1)
[ -n "$version" ] || error 'Failed to find the latest VARA FM version on winlink.org'

APPDIR="${HOME}"/.local/share/applications

#Installing wine
if [ $arch == 32 ]; then
"$DIRECTORY/manage" install-if-not-installed 'Wine (x86)' || error 'Failed to install wine'
elif [ $arch == 64 ]; then
"$DIRECTORY/manage" install-if-not-installed 'Wine (x64)' || error 'Failed to install wine'
fi

#Configuring wineprefix for VARA programs
BOX86_NOBANNER=1 BOX64_NOBANNER=1 winetricks -q vb6run pdh_nt4 sound=alsa

#Downloading VARA FM
VARAFMDIR=/tmp/VARAFM
mkdir -p "${VARAFMDIR}"
wget "https://downloads.winlink.org/VARA%20Products/$version" -O "${VARAFMDIR}/VARAFM-setup.zip" || error 'Failed to download VARA FM Installer from winlink.org'

#Extracting VARA FM installer archives
unzip -o "${VARAFMDIR}/VARAFM-setup.zip" -d "${VARAFMDIR}" || error 'Failed to unzip VARA FM archive'
VARAINSTALLEREXE=$(find "${VARAFMDIR}" -type f -iname "*setup*.exe")

#Manually installing VARA FM program files
# extracting program files from VARA FM installer
install_packages innoextract libsdl2-2.0-0 libxkbregistry0
innoextract -d "${VARAFMDIR}" "${VARAINSTALLEREXE}" || error 'Failed to extract program files from VARA FM installer'
# finding your default wineprefix directory
if [ -z "${WINEPREFIX}" ]; then
PREFIXDIR="${HOME}"/.wine #if "WINEPREFIX=" envvar is unset or set to empty string, wineprefix location is "~/.wine"
else
PREFIXDIR="${WINEPREFIX}" #if "WINEPREFIX=" envvar was previously set, wineprefix location is "$WINEPREFIX"
fi
# moving VARA FM program files to user's default wineprefix
mkdir "${PREFIXDIR}/drive_c/VARAFM" 2>/dev/null #VARAFM folder with old settings might already exist
cp -r "${VARAFMDIR}"/app/* "${PREFIXDIR}"/drive_c/VARAFM/ || error 'Could not copy VARA program files to your wineprefix' #will not overwrite old settings
# registering VB6 OCX and DLL files with your wineprefix
BOX86_NOBANNER=1 BOX64_NOBANNER=1 WINEDEBUG=-all wine regsvr32 "${PREFIXDIR}"/drive_c/VARAFM/OCX/*.*[A-Z] /s || error 'Could not register VARA FM VB6 libraries with your wineprefix' # the lower-case OCX/DLL files don't have built-in register/unregister functions. Wine also already has an emulated psapi.dll that works fine.

#Removing tmp files
rm -rf "${VARAFMDIR}"

#Adding the user to the USB dialout group so that they can access radio USB CAT control later if needed
sudo usermod -a -G dialout $USER

#Creating Desktop Entry
mkdir -p "${APPDIR}"/VARA
echo "[Desktop Entry]
Name=VARA FM
GenericName=VARA FM
Comment=VARA FM is a shareware ham radio OFDM software modem for RMS Express and other messaging clients.
Exec=env WINEPREFIX=\"${PREFIXDIR}\" WINEDEBUG=-all wine \"${PREFIXDIR}/drive_c/VARAFM/VARAFM.exe\"
Icon=$(dirname "$0")/icon-64.png
Terminal=false
StartupNotify=false
Type=Application
StartupWMClass=varafm.exe
Categories=Network;HamRadio;Utility;" > "${APPDIR}"/VARA/varafm.desktop || error 'Failed to create menu button!'
sudo rm -rf "${APPDIR}/wine/Programs/VARA FM" # remove wine's auto-generated VARA FM program icon from the start menu

true
29 changes: 29 additions & 0 deletions apps/VARA FM/uninstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

APPDIR="${HOME}"/.local/share/applications

#Finding your default wineprefix directory
if [ -z "${WINEPREFIX}" ]; then
PREFIXDIR="${HOME}"/.wine #if "WINEPREFIX=" envvar is unset or set to empty string, wineprefix location is "~/.wine"
else
PREFIXDIR="${WINEPREFIX}" #if "WINEPREFIX=" envvar was previously set, wineprefix location is "$WINEPREFIX"
fi

#Unregistering OCX/DLL files from your wineprefix if they exist
OCXDIR="${PREFIXDIR}"/drive_c/VARAFM/OCX
for ACTIVEXFILE in "${OCXDIR}/COMDLG32.OCX" "${OCXDIR}/MSCHRT20.OCX" "${OCXDIR}/MSCOMCTL.OCX" "${OCXDIR}/MSCOMM32.OCX" "${OCXDIR}/MSSTDFMT.DLL" "${OCXDIR}/MSWINSCK.OCX"; do
if [ -f "${ACTIVEXFILE}" ]; then
BOX86_NOBANNER=1 BOX64_NOBANNER=1 WINEDEBUG=-all wine regsvr32 "${PREFIXDIR}"/drive_c/VARAFM/OCX/*.*[A-Z] /u /s || warning 'Could not unregister VARA FM VB6 libraries with your wineprefix' # the lower-case OCX/DLL files don't have built-in register/unregister functions
break
fi
done

#Removing program files (keeping any VARA.ini settings files)
mv -f "${PREFIXDIR}"/drive_c/VARAFM/VARA.ini /tmp/VARA.ini 2>/dev/null
rm -rf "${PREFIXDIR}"/drive_c/VARAFM/* 2>/dev/null || warning 'Could not remove VARA program files. If you moved VARA within Wine or made a custom wineprefix, you might have to remove VARA manually.'
mv /tmp/VARA.ini "${PREFIXDIR}"/drive_c/VARAFM/VARA.ini 2>/dev/null
rmdir "${PREFIXDIR}/drive_c/VARAFM" 2>/dev/null || true #delete directory if empty, prevent error code

#Removing Desktop Entry
rm "${APPDIR}"/VARA/varafm.desktop 2>/dev/null || warning 'Could not remove menu button. You might need to do this manually if you moved it.'
rmdir "${APPDIR}/VARA" 2>/dev/null || true #delete directory if empty, prevent error code
1 change: 1 addition & 0 deletions apps/VARA FM/website
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://downloads.winlink.org/
Loading