diff --git a/apps/Wine (x86)/credits b/apps/Wine (x86)/credits index 9b179c8594..36b75ba798 100644 --- a/apps/Wine (x86)/credits +++ b/apps/Wine (x86)/credits @@ -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 diff --git a/apps/Wine (x86)/description b/apps/Wine (x86)/description index 176ff66d8f..f1612ed8ff 100644 --- a/apps/Wine (x86)/description +++ b/apps/Wine (x86)/description @@ -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. diff --git a/apps/Wine (x86)/install-32 b/apps/Wine (x86)/install-32 index 4dfc4503fe..761f1a07bc 100755 --- a/apps/Wine (x86)/install-32 +++ b/apps/Wine (x86)/install-32 @@ -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 @@ -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 @@ -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... " @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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] diff --git a/apps/Wine (x86)/uninstall b/apps/Wine (x86)/uninstall index 056f3b6cc4..093dae8a34 100755 --- a/apps/Wine (x86)/uninstall +++ b/apps/Wine (x86)/uninstall @@ -1,5 +1,7 @@ #!/bin/bash +version=8.10 + pkill -9 wine command -v wineserver >/dev/null && wineserver -k @@ -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"