diff --git a/apps/VARA FM/credits b/apps/VARA FM/credits new file mode 100644 index 0000000000..3b1af1ce71 --- /dev/null +++ b/apps/VARA FM/credits @@ -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 diff --git a/apps/VARA FM/description b/apps/VARA FM/description new file mode 100644 index 0000000000..a52fc51990 --- /dev/null +++ b/apps/VARA FM/description @@ -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. diff --git a/apps/VARA FM/icon-24.png b/apps/VARA FM/icon-24.png new file mode 100644 index 0000000000..0feb9c72ff Binary files /dev/null and b/apps/VARA FM/icon-24.png differ diff --git a/apps/VARA FM/icon-64.png b/apps/VARA FM/icon-64.png new file mode 100644 index 0000000000..55bd93d787 Binary files /dev/null and b/apps/VARA FM/icon-64.png differ diff --git a/apps/VARA FM/install b/apps/VARA FM/install new file mode 100755 index 0000000000..c882368558 --- /dev/null +++ b/apps/VARA FM/install @@ -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 diff --git a/apps/VARA FM/uninstall b/apps/VARA FM/uninstall new file mode 100755 index 0000000000..843a06e5c3 --- /dev/null +++ b/apps/VARA FM/uninstall @@ -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 diff --git a/apps/VARA FM/website b/apps/VARA FM/website new file mode 100644 index 0000000000..7a2ced3875 --- /dev/null +++ b/apps/VARA FM/website @@ -0,0 +1 @@ +https://downloads.winlink.org/