added ocx files locally, changed script to use these. added purge option

This commit is contained in:
tb14
2025-07-02 00:56:20 -05:00
parent f2c2844542
commit b7a49a1250
7 changed files with 98 additions and 22 deletions
+95 -22
View File
@@ -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 <filename>"; 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=$?