Skip to content

Commit

Permalink
Wine (x86): update to Wine 8.10
Browse files Browse the repository at this point in the history
correct mono and gekco install to follow documentation https://wiki.winehq.org/Mono https://wiki.winehq.org/Gecko
  • Loading branch information
theofficialgman committed Jun 10, 2023
1 parent f1cb46f commit 915d089
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 42 deletions.
81 changes: 40 additions & 41 deletions apps/Wine (x86)/install-32
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ else
fi
#Past this point, the pi is running a Wine-compatible kernel.

version=8.10

#install box86
"${DIRECTORY}/manage" install-if-not-installed Box86 || error "Box86 failed to install somehow!"
if ! command -v box86 >/dev/null ;then
Expand All @@ -142,56 +144,53 @@ box86 -v || error "User error: Something went wrong when trying to run Box86."
pkill -9 wine
command -v wineserver >/dev/null && wineserver -k
command -v wine >/dev/null && sudo apt purge -y wine &>/dev/null &
sudo rm -rf /usr/local/bin/wine /usr/local/bin/wineboot /usr/local/bin/wineserver /usr/local/bin/winecfg /usr/local/bin/winetricks ~/wine.tgz /opt/wine ~/.cache/winetricks ~/.cache/wine 2>/dev/null
sudo rm -rf /usr/local/bin/wine /usr/local/bin/wineboot /usr/local/bin/wineserver /usr/local/bin/winecfg /usr/local/bin/winetricks /opt/wine-${version} ~/.cache/winetricks ~/.cache/wine 2>/dev/null

# Get dependencies
install_packages cabextract p7zip-full || exit 1
# Download wine to /opt
wget https://github.com/phoenixbyrd/TwisterOS/raw/master/wine.tgz -O /tmp/wine.tgz || error 'Failed to download wine!'
sudo tar zxf /tmp/wine.tgz -C /opt --no-same-owner || error 'Failed to extract wine!' #use the --no-same-owner flag, because we want the folder's owner to be root, not hardcoded as pi.
rm -f /tmp/wine.tgz
[ ! -f /opt/wine/bin/wine ] && error "The wine.tgz extraction succeeded, but the file '/opt/wine/bin/wine' is missing!"
wget https://github.com/Pi-Apps-Coders/files/releases/download/large-files/wine-i386-${version}.tar.gz -O /tmp/wine-${version}.tar.gz || error 'Failed to download wine!'
sudo tar -xvf /tmp/wine-${version}.tar.gz -C /opt || error 'Failed to extract wine!'
rm -f /tmp/wine-${version}.tar.gz

#edit wine.inf to disable mime-associations. Nobody wants to double-click a text file, wonder why nothing is happening, then watch 15 Wine notepad windows pop up. Ask me how I know.
sudo sed -i 's/winemenubuilder.exe -a -r/winemenubuilder.exe -r/' /opt/wine/share/wine/wine.inf #See: https://askubuntu.com/a/400430
sudo sed -i 's/winemenubuilder.exe -a -r/winemenubuilder.exe -r/' /opt/wine-${version}/share/wine/wine.inf #See: https://askubuntu.com/a/400430

#download winetricks - old version that does not display a warning about old wine version
wget -O /tmp/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/66af4adb7c22955277aec34e89f12825b6ca75b7/src/winetricks" || exit 1
sudo mv /tmp/winetricks /opt/wine/bin/winetricks || error "Failed to move winetricks script to /opt/wine/bin folder!"
sudo chmod +x /opt/wine/bin/winetricks
#download winetricks
wget -O /tmp/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" || exit 1
sudo mv /tmp/winetricks /opt/wine-${version}/bin/winetricks || error "Failed to move winetricks script to /opt/wine-${version}/bin folder!"
sudo chmod +x /opt/wine-${version}/bin/winetricks

#download Mono to universal location (to be installed automatically in all wine prefixes)
#according to https://wiki.winehq.org/Mono#Versions, use Mono 5.1.0 for Wine 5.13
sudo mkdir -p /opt/wine/mono
wget -O "/tmp/wine-mono-5.1.0-x86.msi" 'https://dl.winehq.org/wine/wine-mono/5.1.0/wine-mono-5.1.0-x86.msi' || exit 1
sudo mv "/tmp/wine-mono-5.1.0-x86.msi" "/opt/wine/mono/wine-mono-5.1.0-x86.msi" || exit 1
#according to https://wiki.winehq.org/Mono#Versions, use Mono 8.0.0 for Wine 8.10
sudo mkdir -p /opt/wine-${version}/mono
wget -O "/tmp/wine-mono-8.0.0-x86.tar.xz" 'https://dl.winehq.org/wine/wine-mono/8.0.0/wine-mono-8.0.0-x86.tar.xz' || exit 1
sudo tar -xvf "/tmp/wine-mono-8.0.0-x86.tar.xz" -C "/opt/wine-${version}/mono" || exit 1

#download Gecko to universal location (to be installed automatically in all wine prefixes)
#according to https://wiki.winehq.org/Gecko, use Gecko 2.47.1 for Wine 5.13
sudo mkdir -p /opt/wine/gecko
wget -O "/tmp/wine-gecko-2.47.1-x86.msi" 'https://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86.msi' || exit 1
sudo mv "/tmp/wine-gecko-2.47.1-x86.msi" "/opt/wine/gecko/wine-gecko-2.47.1-x86.msi" || exit 1
#according to https://wiki.winehq.org/Gecko, use Gecko 2.47.4 for Wine 8.10
sudo mkdir -p /opt/wine-${version}/gecko
wget -O "/tmp/wine-gecko-2.47.4-x86.tar.xz" 'https://dl.winehq.org/wine/wine-gecko/2.47.4/wine-gecko-2.47.4-x86.tar.xz' || exit 1
sudo tar -xvf "/tmp/wine-gecko-2.47.4-x86.tar.xz" -C "/opt/wine-${version}/gecko" || exit 1

status "Creating terminal commands:"
echo " - winecfg"
sudo ln -s /opt/wine/bin/winecfg /usr/local/bin/winecfg
sudo ln -s /opt/wine-${version}/bin/winecfg /usr/local/bin/winecfg
echo " - wineserver"
sudo ln -s /opt/wine/bin/wineserver /usr/local/bin/wineserver
sudo ln -s /opt/wine-${version}/bin/wineserver /usr/local/bin/wineserver
echo " - wineboot"
sudo ln -s /opt/wine/bin/wineboot /usr/local/bin/wineboot
sudo ln -s /opt/wine-${version}/bin/wineboot /usr/local/bin/wineboot

echo " - wine"
echo "#!/bin/bash
if [ -d /opt/wine/mesa ];then
export LD_LIBRARY_PATH=/opt/wine/mesa/lib/arm-linux-gnueabihf/
export LIBGL_DRIVERS_PATH=/opt/wine/mesa/lib/arm-linux-gnueabihf/dri/
export VK_ICD_FILENAMES=/opt/wine/mesa/share/vulkan/icd.d/broadcom_icd.armv7l.json
if [ -d /opt/wine-${version}/mesa ];then
export LD_LIBRARY_PATH=/opt/wine-${version}/mesa/lib/arm-linux-gnueabihf/
export LIBGL_DRIVERS_PATH=/opt/wine-${version}/mesa/lib/arm-linux-gnueabihf/dri/
export VK_ICD_FILENAMES=/opt/wine-${version}/mesa/share/vulkan/icd.d/broadcom_icd.armv7l.json
fi
/opt/wine/bin/wine"' "$@"' | sudo tee /usr/local/bin/wine >/dev/null
/opt/wine-${version}/bin/wine"' "$@"' | sudo tee /usr/local/bin/wine >/dev/null

echo " - winetricks"
echo "#!/bin/bash
BOX86_NOBANNER=1 /opt/wine/bin/winetricks"' "$@"' | sudo tee /usr/local/bin/winetricks >/dev/null
BOX86_NOBANNER=1 /opt/wine-${version}/bin/winetricks"' "$@"' | sudo tee /usr/local/bin/winetricks >/dev/null

#make them all executable
status -n "Making executable... "
Expand All @@ -203,11 +202,11 @@ echo
cd /tmp
rm -rf "$PWD/wine-stuff"
git clone https://github.com/Botspot/wine-stuff || error "Failed to clone wine-stuff repository!"
sudo mv "$PWD/wine-stuff/icons" /opt/wine
sudo mv "$PWD/wine-stuff/Windows_10.msstyles" /opt/wine
sudo mv "$PWD/wine-stuff/icons" /opt/wine-${version}
sudo mv "$PWD/wine-stuff/Windows_10.msstyles" /opt/wine-${version}
if [ $(ldd --version | head -n1 | awk '{print $NF}' | sed 's/\..*//g') -ge 2 ] && [ "$(ldd --version | head -n1 | awk '{print $NF}' | sed 's/.*\.//g')" -ge 30 ];then
#only install mesa if glibc is 2.30 or greater
sudo mv "$PWD/wine-stuff/mesa" /opt/wine
sudo mv "$PWD/wine-stuff/mesa" /opt/wine-${version}
fi
rm -rf "$PWD/wine-stuff"
cd
Expand All @@ -230,7 +229,7 @@ Terminal=false
Type=Application
Name=Wine Configuration
Exec=wine winecfg
Icon=/opt/wine/icons/winecfg.png
Icon=/opt/wine-${version}/icons/winecfg.png
Categories=System;
Comment=Configure wine" | sudo tee /usr/share/applications/wine-config.desktop

Expand All @@ -239,7 +238,7 @@ Name=Winetricks
Comment=Work around problems and install applications under Wine
Exec=bash -c 'BOX86_NOBANNER=1 box86 winetricks --gui'
Terminal=false
Icon=/opt/wine/icons/winetricks.png
Icon=/opt/wine-${version}/icons/winetricks.png
Type=Application
Categories=System;" | sudo tee /usr/share/applications/wine-tricks.desktop

Expand All @@ -248,7 +247,7 @@ Version=1.0
Type=Application
Name=Wine Desktop
Comment=Wine graphical desktop environment to mimic a Windows OS
Icon=/opt/wine/icons/wine-desktop.png
Icon=/opt/wine-${version}/icons/wine-desktop.png
Exec=wine explorer /desktop=shell,1280x720
Terminal=false
Categories=System;" | sudo tee /usr/share/applications/wine-explorer.desktop
Expand All @@ -258,7 +257,7 @@ Version=1.0
Type=Application
Name=Wine Program Manager
Comment=Install/Remove Windows programs
Icon=/opt/wine/icons/wine-program-manager.png
Icon=/opt/wine-${version}/icons/wine-program-manager.png
Exec=wine uninstaller
Terminal=false
Categories=System;" | sudo tee /usr/share/applications/wine-uninstaller.desktop
Expand All @@ -268,7 +267,7 @@ Version=1.0
Type=Application
Name=Wine Task Manager
Comment=View running processes within Wine
Icon=/opt/wine/icons/winetask.png
Icon=/opt/wine-${version}/icons/winetask.png
Exec=wine taskmgr
Terminal=false
Categories=System;" | sudo tee /usr/share/applications/wine-taskmgr.desktop
Expand All @@ -279,7 +278,7 @@ Version=1.0
Type=Application
Name=Wine Killer
Comment=Terminate any running Wine processes
Icon=/opt/wine/icons/winestop.png
Icon=/opt/wine-${version}/icons/winestop.png
Exec=wineserver -k
Terminal=false
Categories=System;" | sudo tee /usr/share/applications/wine-killer.desktop
Expand All @@ -289,8 +288,8 @@ Version=1.0
Type=Application
Name=Wine Reset
Comment=Clean out the default Wine prefix and start over
Icon=/opt/wine/icons/wine-regenerate.png
Exec=bash -c "\""yad --window-icon=/opt/wine/icons/wine-regenerate.png --title='Wine Reset' --text='Are you sure you want to DELETE all data and applications in your Wine prefix and start over?' --center --button=Cancel:1 --button=Yes:0 --on-top && ${DIRECTORY}/etc/terminal-run 'echo y | winetricks annihilate -q ; generate-wine-prefix' 'Generating Wine prefix...'"\""
Icon=/opt/wine-${version}/icons/wine-regenerate.png
Exec=bash -c "\""yad --window-icon=/opt/wine-${version}/icons/wine-regenerate.png --title='Wine Reset' --text='Are you sure you want to DELETE all data and applications in your Wine prefix and start over?' --center --button=Cancel:1 --button=Yes:0 --on-top && ${DIRECTORY}/etc/terminal-run 'echo y | winetricks annihilate -q ; generate-wine-prefix' 'Generating Wine prefix...'"\""
Terminal=false
Categories=System;" | sudo tee /usr/share/applications/wine-regenerate.desktop
status_green "Done"
Expand Down Expand Up @@ -352,7 +351,7 @@ echo '
echo " - Windows 10 appearance theme"
mkdir -p "\$WINEPREFIX/drive_c/windows/Resources/Themes/Windows_10"
cp -f /opt/wine/Windows_10.msstyles "\$WINEPREFIX/drive_c/windows/Resources/Themes/Windows_10"
cp -f /opt/wine-${version}/Windows_10.msstyles "\$WINEPREFIX/drive_c/windows/Resources/Themes/Windows_10"
echo '
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager]
Expand Down
2 changes: 1 addition & 1 deletion apps/Wine (x86)/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sudo rm -rf /usr/local/bin/wine /usr/local/bin/winecfg /usr/local/bin/wineserver
status_green "Done"

status -n "Removing Wine folders... "
sudo rm -rf /opt/wine
sudo rm -rf /opt/wine-*
rm -rf ~/.cache/winetricks ~/.cache/wine
status_green "Done"

Expand Down

0 comments on commit 915d089

Please sign in to comment.