Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wine (x86): update to Wine 8.10 #2356

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/Wine (x86)/credits
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Script by Itai-Nelken and Botspot
Wine Developers: https://wiki.winehq.org/Who%27s_Who
Box86 Developer: @ptitSeb on GitHub
Script Writer and Packager: @theofficialgman and other pi-apps contributors on GitHub
2 changes: 1 addition & 1 deletion apps/Wine (x86)/description
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Run x86 Windows apps with a box86-emulated version of x86 wine.
Run x86 Windows apps with a box86-emulated version of x86 wine-8.10.
To run: wine path/to/file.exe
To configure wine: go to 'Wine configuration' in main menu or type in terminal: wine winecfg
Not all Windows applications will work under Wine. It's a good idea to check online if your program can run, or if something can be tweaked to make it work.
Expand Down
136 changes: 69 additions & 67 deletions apps/Wine (x86)/install-32
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
#!/bin/bash
if grep -q ARMv7 /proc/cpuinfo ;then
hardware='pi3'
elif grep -q ARMv6 /proc/cpuinfo ;then
hardware='pi0'
if grep -q ARMv6 /proc/cpuinfo ;then
error "Wine is not compatible with the Raspberry Pi Zero or other ARMv6 boards."
else
hardware='pi4'
fi

if [ ! -e /proc/config.gz ];then
sudo modprobe configs || exit 1
if [ ! -e /proc/config.gz ];then
error "/proc/config.gz does not exist after running sudo modprobe configs!"
kernel="$(uname -m)"
if ! [[ "$kernel" =~ "64" ]] && [ "$GITHUB_ACTIONS" != "true" ]; then
if [ -e /boot/config-$(uname -r) ];then
vmsplit_output="$(cat /boot/config-$(uname -r) | grep VMSPLIT)"
else
if [ ! -e /proc/config.gz ];then
sudo modprobe configs || exit 1
if [ ! -e /proc/config.gz ];then
error "/proc/config.gz does not exist after running sudo modprobe configs!"
fi
fi
vmsplit_output="$(gunzip < /proc/config.gz | grep VMSPLIT)"
fi
fi

vmsplit_output="$(gunzip < /proc/config.gz | grep VMSPLIT)"
if [ -z "$vmsplit_output" ];then
kernel="$(uname -m)"
if [ $kernel == aarch64 ];then
echo "No memory split information due to running a 64-bit kernel. Continuing..."
if [[ "$kernel" =~ "64" ]];then
status "No memory split information due to running a $kernel kernel. Continuing..."
else
echo "No memory split information and not running a 64-bit kernel. Strange."
sleep 2
echo "Continuing..."
status "No memory split information and running a $kernel kernel. Strange."
status "Continuing..."
fi
elif echo "$vmsplit_output" | grep -q "^CONFIG_VMSPLIT_2G=y" || echo "$vmsplit_output" | grep -q "^# CONFIG_VMSPLIT_3G is not set" ;then

#ensure hardware is armv7 for kernel compiling to work
if [ "$hardware" != 'pi3' ];then
error "User error: This script is not capable of handling your $hardware board with a 2G/2G memory split.\nWhatever you did to get yourself into this situation, undo it and try installing Wine again."
#ensure /boot/config.txt exists to make sure this is a rpi board
elif [ ! -f /boot/config.txt ];then
error "User error: Your system is not currently compatible with Wine. It needs a kernel with 3G/1G memory split. This is easy to do: switch to the 64-bit kernel by adding a line to /boot/config.txt. However, that file does not exist. Most likely you are trying to use Pi-Apps on an unsupported device or operating system."
#ensure hardware is bcm2836/bcm2837 for kernel compiling to work
#note that bcm2709 dts has a compatible tag of bcm2836 so SOC_ID will be bcm2836
# obtain SOC_ID
get_model
if [ "$SOC_ID" == 'bcm2836' ] || [ "$SOC_ID" == 'bcm2837' ];then
true
else
error "User error: This script is not capable of handling your $SOC_ID soc with a 2G/2G memory split.\nWhatever you did to get yourself into this situation, undo it and try installing Wine again."
fi

#continue asking until valid answer
Expand Down Expand Up @@ -130,6 +131,9 @@ else
fi
#Past this point, the pi is running a Wine-compatible kernel.

#note to maintainer, if you change the below version make sure to update it in the uninstall script as well
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 +146,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}/share/wine/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}/share/wine/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}/share/wine/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}/share/wine/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 +204,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
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/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 ] && ! package_is_new_enough libgl1-mesa-dri 22.1.0 ;then
#only install mesa if glibc is 2.30 or greater and apt mesa version is less than 22.1.0 (which is the version of the binary builds)
sudo mv "$PWD/wine-stuff/mesa" /opt/wine-${version}
fi
rm -rf "$PWD/wine-stuff"
cd
Expand All @@ -230,7 +231,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 +240,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 +249,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 +259,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 +269,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 +280,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,13 +290,14 @@ 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"

cat << EOF | sudo tee /usr/local/bin/generate-wine-prefix >/dev/null
#!/bin/bash
echo

#set up functions
Expand Down Expand Up @@ -352,7 +354,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
4 changes: 3 additions & 1 deletion apps/Wine (x86)/uninstall
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

version=8.10

pkill -9 wine
command -v wineserver >/dev/null && wineserver -k

Expand All @@ -8,7 +10,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-${version}
rm -rf ~/.cache/winetricks ~/.cache/wine
status_green "Done"

Expand Down