From 51095fabab0b8a20058d194dcc5cee59fafe66db Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 24 Mar 2026 11:18:32 -0600 Subject: [PATCH] install winlink --- install-windows-apps.sh | 118 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 111 insertions(+), 7 deletions(-) diff --git a/install-windows-apps.sh b/install-windows-apps.sh index f7e7eb8..91dbd9f 100755 --- a/install-windows-apps.sh +++ b/install-windows-apps.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Purpose : Download latest VARA HF, FM and Terminal zips from winlink.org +# Purpose : Download latest VARA HF, FM, Terminal and Winlink Express from winlink.org BASE_URL="https://downloads.winlink.org" DOWNLOAD_DIR="/tmp/windowsapps" @@ -68,6 +68,59 @@ download_vara() { fi } +# Download and extract Winlink Express +download_winlink() { + local page + page=$(curl -s "https://downloads.winlink.org/User%20Programs/") + + if [ -z "$page" ]; then + echo "Error: could not fetch Winlink User Programs page." + return 1 + fi + + local encoded + encoded=$(echo "$page" | grep -oP 'HREF="\K[^"]+' | grep -i "Winlink_Express_install") + + if [ -z "$encoded" ]; then + echo "Error: could not find Winlink Express install zip on page." + return 1 + fi + + local filename + filename=$(echo "$encoded" | sed 's|.*/||; s|%20| |g') + + local version + version=$(echo "$filename" | grep -oP '\d+[-\.\d]+' | head -n1) + + echo "Found Winlink Express version: $version" + echo "Filename: $filename" + + local download_url="https://downloads.winlink.org$encoded" + local filepath="$DOWNLOAD_DIR/$filename" + local extract_dir="$DOWNLOAD_DIR/Winlink_Express" + + echo "Downloading $filename..." + wget -q "$download_url" -O "$filepath" + + if [ $? -ne 0 ]; then + echo "Error: download of $filename failed." + return 1 + fi + + echo "Extracting to $extract_dir..." + rm -rf "$extract_dir" + mkdir -p "$extract_dir" + unzip -q "$filepath" -d "$extract_dir" + + if [ $? -eq 0 ]; then + echo "Extracted Winlink Express version $version to $extract_dir" + rm -f "$filepath" + else + echo "Error: extraction of $filename failed." + return 1 + fi +} + # Install a VARA product using Wine install_vara() { local pattern="$1" @@ -106,10 +159,54 @@ install_vara() { echo "$exe_name installation complete." } -# Download all VARA products +# Install Winlink Express using Wine +install_winlink() { + local wine_dir="$HOME/.wine/drive_c/RMS Express" + local extract_dir="$DOWNLOAD_DIR/Winlink_Express" + + # Check if already installed + if [ -d "$wine_dir" ]; then + echo " Winlink Express is already installed, skipping." + return 0 + fi + + if [ ! -d "$extract_dir" ]; then + echo "Error: directory $extract_dir not found, skipping." + return 1 + fi + + local exe + exe=$(find "$extract_dir" -maxdepth 1 -iname "Winlink_Express_install*.exe" | head -n1) + + if [ -z "$exe" ]; then + echo "Error: no Winlink Express exe found in $extract_dir, skipping." + return 1 + fi + + local exe_name=$(basename "$exe") + echo "" + echo "=== Installing $exe_name ===" + echo "Please complete the installation in the Wine window." + echo "The script will continue once the installer is closed." + echo "" + + wine "$exe" + + echo "$exe_name installation complete." +} + +# Download all products download_vara "VARA HF" download_vara "VARA FM" download_vara "VARA Terminal" +download_winlink + +# Initialize Wine if not already done +if [ ! -d "$HOME/.wine" ]; then + echo "Initializing Wine..." + wineboot --init + echo "Wine initialized." +fi # Update Wine registry to disable window decorations USER_REG="$HOME/.wine/user.reg" @@ -118,12 +215,18 @@ if [ ! -f "$USER_REG" ]; then echo "Warning: $USER_REG not found, skipping registry update." else echo "Updating Wine registry..." - sed -i 's/"Decorated"="Y"/"Decorated"="N"/' "$USER_REG" + if grep -q '"Decorated"="Y"' "$USER_REG"; then + sed -i 's/"Decorated"="Y"/"Decorated"="N"/' "$USER_REG" + elif grep -q '"Decorated"' "$USER_REG"; then + sed -i 's/"Decorated"=.*/"Decorated"="N"/' "$USER_REG" + else + echo '"Decorated"="N"' >> "$USER_REG" + fi echo "Set Decorated=N in $USER_REG" fi echo "" -echo "All VARA products downloaded and extracted to $DOWNLOAD_DIR" +echo "All products downloaded and extracted to $DOWNLOAD_DIR" # Install Wine dependencies echo "" @@ -137,17 +240,18 @@ fi echo "Wine dependencies installed successfully." -# Install all VARA products +# Install all products echo "" -echo "Starting VARA installations..." +echo "Starting installations..." install_vara "VARA HF" "$HOME/.wine/drive_c/VARA" install_vara "VARA FM" "$HOME/.wine/drive_c/VARA FM" install_vara "VARA Terminal" "$HOME/.wine/drive_c/VARA" +install_winlink echo "" echo "Updating desktop database..." update-desktop-database "$HOME/.local/share/applications/" echo "" -echo "All VARA installations complete." \ No newline at end of file +echo "All installations complete." \ No newline at end of file