diff --git a/AmRRON-Vara-setup.sh b/AmRRON-Vara-setup.sh index 69dabbc..53e5c22 100755 --- a/AmRRON-Vara-setup.sh +++ b/AmRRON-Vara-setup.sh @@ -354,7 +354,8 @@ DISPLAY=0 WINEARCH=win32 wine wineboot || winetricks -q dotnet35sp1 win7 sound=pulse || { ERRCODE="Failed to set winetricks dotnet35sp1 win7 sound=pulse"; errors; return; } winetricks -q vb6run win7 sound=pulse || # removed pdh_nt4 -{ ERRCODE="Failed to set winetricks vb6run win7 sound=pulse"; errors; return; } +sudo apt-get install --reinstall ca-certificates || +{ ERRCODE="Failed to run winetricks vb6run win7 sound=pulse"; errors; return; } #cleanup cache from installers rm -rf ~/.cache/winetricks/ || @@ -382,17 +383,45 @@ sudo apt install -y curl p7zip-full winbind|| fi -#Install Driver -if [[ ! -f $HOME/.wine/drive_c/windows/system32/pdh.dll ]]; then -cd $HOME/Downloads && wget http://files.k6eta.com/pdh.dll.zip || -{ ERRCODE="Failed to download k6eta pdh.dll drivers"; errors; return; } -unzip pdh.dll.zip && rm pdh.dll.zip || -{ ERRCODE="Failed to unzip k6eta drivers"; errors; return; } -mv pdh.dll $HOME/.wine/drive_c/windows/system32 || -{ ERRCODE="Failed to move drivers to $HOME/.wine/drive_c/windows/system32"; errors; return; } -else -echo "Driver already installed" -fi +#Install Drivers +#if [[ ! -f $HOME/.wine/drive_c/windows/system32/pdh.dll ]]; then +#cd $HOME/Downloads && wget http://files.k6eta.com/pdh.dll.zip || +#{ ERRCODE="Failed to download k6eta pdh.dll drivers"; errors; return; } +#unzip pdh.dll.zip && rm pdh.dll.zip || +#{ ERRCODE="Failed to unzip k6eta drivers"; errors; return; } +#mv pdh.dll $HOME/.wine/drive_c/windows/system32 || +#{ ERRCODE="Failed to move drivers to $HOME/.wine/drive_c/windows/system32"; errors; return; } +#else +#echo "PDH.dll Driver already installed" +#fi + +# Define the target directory and the source directory +TARGET_DIR="$HOME/.wine/drive_c/windows/system32" +SOURCE_DIR="$DIR/Files/ocx" + +# Define the files to check +FILES=("pdh.dll" "MSCHRT20.OCX" "MSCOMCTL.OCX" "MSCOMM32.OCX" "mswinsck.ocx") + +# Function to register a DLL with wine regsvr32 and avoid user interaction +register_dll() { + local dll=$1 + wine regsvr32 /s "$dll" +} + +# Loop through each file and perform the check and copy operation +for FILE in "${FILES[@]}"; do + if [ ! -f "$TARGET_DIR/$FILE" ]; then + echo "$FILE not found in $TARGET_DIR. Copying from $SOURCE_DIR." + cp "$SOURCE_DIR/$FILE" "$TARGET_DIR/" || + { ERRCODE="Failed to copy $FILE to $TARGET_DIR"; errors; return; } + else + echo "$FILE already exists in $TARGET_DIR." + fi + + # Register the DLL with wine regsvr32 + register_dll "$TARGET_DIR/$FILE" || + { ERRCODE="Failed to register $FILE with wine regsvr32"; errors; return; } +done cd $HOME/Downloads && if ls VARA* 1> /dev/null 2>&1; then rm VARA* 2>/dev/null; fi && wget ${VARAHFLINK} || @@ -421,16 +450,33 @@ sudo apt install -y curl p7zip-full winbind|| fi -if [[ ! -f $HOME/.wine/drive_c/windows/system32/pdh.dll ]]; then -cd $HOME/Downloads && wget http://files.k6eta.com/pdh.dll.zip || -{ ERRCODE="Failed to download k6eta pdh.dll drivers"; errors; return; } -unzip pdh.dll.zip && rm pdh.dll.zip || -{ ERRCODE="Failed to unzip k6eta drivers"; errors; return; } -mv pdh.dll $HOME/.wine/drive_c/windows/system32 || -{ ERRCODE="Failed to move drivers to $HOME/.wine/drive_c/windows/system32"; errors; return; } -else -echo "Driver already installed" -fi +# Define the target directory and the source directory +TARGET_DIR="$HOME/.wine/drive_c/windows/system32" +SOURCE_DIR="$DIR/Files/ocx" + +# Define the files to check +FILES=("pdh.dll" "MSCHRT20.OCX" "MSCOMCTL.OCX" "MSCOMM32.OCX" "mswinsck.ocx") + +# Function to register a DLL with wine regsvr32 and avoid user interaction +register_dll() { + local dll=$1 + wine regsvr32 /s "$dll" +} + +# Loop through each file and perform the check and copy operation +for FILE in "${FILES[@]}"; do + if [ ! -f "$TARGET_DIR/$FILE" ]; then + echo "$FILE not found in $TARGET_DIR. Copying from $SOURCE_DIR." + cp "$SOURCE_DIR/$FILE" "$TARGET_DIR/" || + { ERRCODE="Failed to copy $FILE to $TARGET_DIR"; errors; return; } + else + echo "$FILE already exists in $TARGET_DIR." + fi + + # Register the DLL with wine regsvr32 + register_dll "$TARGET_DIR/$FILE" || + { ERRCODE="Failed to register $FILE with wine regsvr32"; errors; return; } +done cd $HOME/Downloads && if ls VARA* 1> /dev/null 2>&1; then rm VARA* 2>/dev/null; fi && wget ${VARAFMLINK} || { ERRCODE="Failed to download VARA FM. Visit https://downloads.winlink.org/ to download appropriate file. Unzip this file and install from terminal using the command: wine "; errors; return; } @@ -496,6 +542,32 @@ wget -q -r -l1 -np -nd -A "Winlink_Express_install_*.zip" https://downloads.winl } +function purge() { + +sudo apt purge -y wine || +{ ERRCODE="Failed to purge wine from apt"; errors; return; } + +if [[ -d $HOME/.wine ]]; then + sudo rm -rf $HOME/.wine || + { ERRCODE="Failed to delete $HOME/.wine directory"; errors; return; } +fi + +# Define an array of desktop icon file names to check and remove +DESKTOP_ICONS=("VarAC.desktop" "VarAC.lnk" "VARA.desktop" "VARA.lnk" "VARA FM.desktop" "VARA FM.lnk" "Winlink Express.desktop") + +# Loop through each desktop icon file and perform the check and removal operation +for ICON in "${DESKTOP_ICONS[@]}"; do + if [[ -f $HOME/Desktop/$ICON ]]; then + rm "$HOME/Desktop/$ICON" || + { ERRCODE="Failed to remove desktop icon for $ICON"; errors; return; } + echo "Removed desktop icon: $ICON" + else + echo "Desktop icon not found: $ICON" + fi +done + +} + ######################################################################################### function installermenu() { @@ -511,6 +583,7 @@ function installermenu() { false "VARAFM" "Vara FM modem" "" \ false "VARAC" "VarAC keyboard to keyboard chat program" "" \ false "RMSEXPRESS" "Winlink RMS Express" "" \ + false "PURGE" "Completely remove wine and all programs" "" \ ${r} ${c} >>/tmp/results rc=$? diff --git a/Files/ocx/MSCHRT20.OCX b/Files/ocx/MSCHRT20.OCX new file mode 100644 index 0000000..c451b84 Binary files /dev/null and b/Files/ocx/MSCHRT20.OCX differ diff --git a/Files/ocx/MSCOMCTL.OCX b/Files/ocx/MSCOMCTL.OCX new file mode 100644 index 0000000..3483fe0 Binary files /dev/null and b/Files/ocx/MSCOMCTL.OCX differ diff --git a/Files/ocx/MSCOMM32.OCX b/Files/ocx/MSCOMM32.OCX new file mode 100644 index 0000000..11fa8b3 Binary files /dev/null and b/Files/ocx/MSCOMM32.OCX differ diff --git a/Files/ocx/mswinsck.ocx b/Files/ocx/mswinsck.ocx new file mode 100644 index 0000000..cc00b76 Binary files /dev/null and b/Files/ocx/mswinsck.ocx differ diff --git a/Files/ocx/pdh.dll b/Files/ocx/pdh.dll new file mode 100644 index 0000000..6ed4e68 Binary files /dev/null and b/Files/ocx/pdh.dll differ diff --git a/changelogs/CHANGELOG-Vara-setup.md b/changelogs/CHANGELOG-Vara-setup.md index 55f5325..44ed9b4 100644 --- a/changelogs/CHANGELOG-Vara-setup.md +++ b/changelogs/CHANGELOG-Vara-setup.md @@ -1,3 +1,6 @@ +# Version 1.2.1 +- in testing, missing .ocx files were discovered. These are not locally hosted in the repo and copied during installation. +- Added option to purge installation. # Version 1.2 - fix error on fresh install where varafm/varahf will not download # Version 1.1.1