Skip to content

Commit

Permalink
add VARA HF app (#2608)
Browse files Browse the repository at this point in the history
* Update credits

* Update uninstall: add rmdir based on code review

Change if statements to rmdir's.
Also make sure VARA.ini overwrites any VARA.ini file in /tmp/ (for edge cases).

* use `install_packages` instead of `sudo apt-get install -y`

* change `echo` to `error` in case of download fail

* remove #version= comment

* change from 'ahk install' to 'manual install'

* along with commit: change 'ahk install' to 'manual install'

* style changes

* style changes

* decided not to check varahf.desktop for wineprefix info

* Update uninstall: Find wineprefix where VARA.exe is installed

* Update uninstall: only return first result of grep; style changes

* Update install: Add WINEPREFIX= env var to program shortcut

* Update uninstall: Add condition if VARA.exe is not found

* fix menu launcher name

* Update uninstall: remove find vara.exe

* Update install: Remove applications/VARA/ folder

* Update uninstall: Remove applications/VARA/ folder

* Update install: Remove applications/VARA/ folder

* Update un/install: Remove applications/VARA/ folder

* Revert "Update un/install: Remove applications/VARA/ folder"

This reverts commit de24174.

* Update uninstall

* Update install

* Update install: Revert VARA icon dir

* Update uninstall: Added warnings instead of errors/echos

* Update uninstall: Check to see if activex files exists before attempting to unregister them

note: cannot -f globs

* Update uninstall: warn user if icon can't be removed

* Update install: Add quotes to desktop entry path

for edge cases when the user's path contains spaces

* Update uninstall: fix typo

* Update install: enable dynarec for activex registrations

* 2 small code improvements

* Update description: Change "box86" to "Box86/Box64"

* Update install

---------

Co-authored-by: Botspot <[email protected]>
  • Loading branch information
WheezyE and Botspot authored Jul 25, 2024
1 parent 5862159 commit ecadbbc
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/VARA HF/credits
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Added to pi-apps by Eric Wiessner (KI7POL)

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 HF/description
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
A shareware HF 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 HF
Run from Terminal: wine "C:\VARA\VARA.exe"

This app runs with the help of Box86/Box64 and Wine.
Binary file added apps/VARA HF/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 HF/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.
61 changes: 61 additions & 0 deletions apps/VARA HF/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

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 HF
VARAHFDIR=/tmp/VARAHF
mkdir "${VARAHFDIR}" 2>/dev/null
wget -q -r -l1 -np -nd "https://downloads.winlink.org/VARA%20Products" -A "VARA HF*setup.zip" -P "${VARAHFDIR}" || error 'Failed to download VARA HF Installer from winlink.org'

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

#Manually installing VARA HF program files
# extracting program files from VARA HF installer
install_packages innoextract
innoextract -d "${VARAHFDIR}" "${VARAINSTALLEREXE}" || error 'Failed to extract program files from VARA HF 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 HF program files to user's default wineprefix
mkdir "${PREFIXDIR}/drive_c/VARA" 2>/dev/null #VARA folder with old settings might already exist
cp -r "${VARAHFDIR}"/app/* "${PREFIXDIR}"/drive_c/VARA/ || 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/VARA/OCX/*.*[A-Z] /s || error 'Could not register VARA HF 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 "${VARAHFDIR}"

#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 HF
GenericName=VARA HF
Comment=VARA HF 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/VARA/VARA.exe\"
Icon=$(dirname "$0")/icon-64.png
Terminal=false
StartupNotify=false
Type=Application
StartupWMClass=vara.exe
Categories=Utility;" > "${APPDIR}"/VARA/varahf.desktop || error 'Failed to create menu button!'
sudo rm -rf "${APPDIR}"/wine/Programs/VARA # remove wine's auto-generated VARA HF program icon from the start menu

true
29 changes: 29 additions & 0 deletions apps/VARA HF/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/VARA/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/VARA/OCX/*.*[A-Z] /u /s || warning 'Could not unregister VARA HF 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/VARA/VARA.ini /tmp/VARA.ini 2>/dev/null
rm -rf "${PREFIXDIR}"/drive_c/VARA/* 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/VARA/VARA.ini 2>/dev/null
rmdir "${PREFIXDIR}/drive_c/VARA" 2>/dev/null || true #delete directory if empty, prevent error code

#Removing Desktop Entry
rm "${APPDIR}"/VARA/varahf.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 HF/website
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://rosmodem.wordpress.com/
1 change: 1 addition & 0 deletions etc/categories
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Ulauncher|Appearance
Unciv|Games
Update Buddy|System Management
USBImager|Tools
VARA HF|Engineering
VeraCrypt|Tools
Visual Studio Code|Programming
Vivaldi|Internet/Browsers
Expand Down

0 comments on commit ecadbbc

Please sign in to comment.