├── README.md ├── cemutil.sh ├── sharedFonts.zip └── ubuntu-wine.sh /README.md: -------------------------------------------------------------------------------- 1 | cemutil -- a Linux CEMU install helper 2 | =============================================================== 3 | 4 | Capabilties 5 | =============================================================== 6 | - Supports downloading latest cemu, cemuzips and graphic packs, then installing them to either ~/.cemu or a location of your choosing. 7 | - Supports using local zips for the install. 8 | - Creates and configures a wineprefix in the install directory, to not impact the default prefix. 9 | - Creates two launch scripts: one for cemu normally (with glthread and vsync flags set), and another for launching Zelda BOTW on gcn3 cards (e.g. polaris, fiji). 10 | 11 | Running 12 | =============================================================== 13 | Run the following commands to download and run the program to see usage capabilities: 14 | ``` 15 | wget -O ./cemutil.sh https://github.com/CEMULinux/cemutil/raw/master/cemutil.sh && chmod +x cemutil.sh && ./cemutil.sh 16 | ``` 17 | 18 | Run the following commands to download and run the program with the '-a' flag to download latest known working Cemu, Cemu Hook and the latest Graphics Packs: 19 | ``` 20 | wget -O ./cemutil.sh https://github.com/CEMULinux/cemutil/raw/master/cemutil.sh && chmod +x cemutil.sh && ./cemutil.sh -a 21 | ``` 22 | 23 | Run the following commands to download and run the program with the '-l' flag to download latest Cemu, Cemu Hook and the latest Graphics Packs: 24 | ``` 25 | wget -O ./cemutil.sh https://github.com/CEMULinux/cemutil/raw/master/cemutil.sh && chmod +x cemutil.sh && ./cemutil.sh -l 26 | ``` 27 | 28 | Support 29 | =============================================================== 30 | Go to #linux on [CEMU Discord](https://discord.gg/5psYsup) 31 | - If you're using an Arch based Distro, it is recommended to build wine-tkg yourself.(https://github.com/Tk-Glitch/PKGBUILDS/tree/master/wine-tkg-git) 32 | 33 | Users with Ubuntu 18.04 and later can run this command in terminal: 34 | ``` 35 | wget -O ./ubuntu-wine.sh https://github.com/HengiFettlich/cemutil/raw/master/ubuntu-wine.sh && chmod +x ubuntu-wine.sh && ./ubuntu-wine.sh 36 | ``` 37 | -------------------------------------------------------------------------------- /cemutil.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if (( $EUID == 0 )); then 4 | echo "Do not run as root." 5 | exit 1 6 | fi 7 | 8 | if [ -z "$DISPLAY" ]; then 9 | export DISPLAY=:0.0 10 | fi 11 | 12 | # help function: 13 | function printhelp { 14 | echo "usage examples:" 15 | echo "Download latest available cemu + cemuhook and install to ~/.cemu (default):" 16 | echo "./cemutil.sh -a" 17 | echo "Use local zips and install to ~/Documents/cemu:" 18 | echo "./cemutil.sh -c cemu.zip -h cemuhook.zip -g graphicpacks.zip -i ~/Documents/cemu" 19 | exit 1 20 | } 21 | 22 | function downloadlatest { 23 | echo "Downloading latest cemu" 24 | wget -q --show-progress -O cemutemp.zip $(curl -s http://cemu.info |grep .zip |awk -F '"' {'print $2'}) 25 | #wget -q --show-progress -O cemutemp.zip http://cemu.info/releases/cemu_1.15.0.zip 26 | echo "Downloading latest cemuhook" 27 | wget -q --show-progress -O cemuhooktemp.zip $(curl -s https://cemuhook.sshnuke.net |grep .zip |awk -F '"' NR==2{'print $2'}) 28 | echo "Downloading cemuhook shared fonts" 29 | wget -q --show-progress -O sharedFonts.zip https://github.com/CEMULinux/cemutil/raw/master/sharedFonts.zip 30 | return 31 | } 32 | 33 | #Check installed software 34 | declare -a reqsw=("wine" "bsdtar" "unzip" "glxinfo" "curl" "wget" "winetricks") 35 | for i in "${reqsw[@]}" 36 | do 37 | if ! [ -x "$(command -v $i)" ]; then 38 | echo "You must install $i" 39 | exit 1 40 | fi 41 | done 42 | 43 | if $(glxinfo | grep -q -e "NVIDIA"); then 44 | skipgfxcheck=1 45 | fi 46 | 47 | function checkgfxver { 48 | echo "Checking graphics packages are new enough. To skip this check (on Nvidia for instance), run with -f flag." 49 | if ! $(glxinfo | grep -q -e 'Mesa 18.2' -e 'Mesa 18.3' -e 'Mesa 18.4' -e 'Mesa 19' -e 'Mesa 20'); then 50 | echo "You must install at least Mesa 18.2.0" 51 | exit 1 52 | fi 53 | 54 | if ! $(glxinfo | grep -q "4.5 (Compat"); then 55 | if ! $(glxinfo | grep -q "4.6 (Compat"); then 56 | echo "Your hardware doesn't support the required OpenGL version." 57 | echo "You may attempt using MESA_GL_VERSION_OVERRIDE=4.4COMPAT in the LaunchCEMU script." 58 | echo "This isn't officially supported, and may cause heavy glitches or not work. Proceeding as usual..." 59 | fi 60 | fi 61 | return 62 | } 63 | 64 | #Check for args 65 | if [[ ! $@ =~ ^\-.+ ]] 66 | then 67 | printhelp; 68 | fi 69 | 70 | #Handle args 71 | while getopts ":c:h:afi:" opt; do 72 | case ${opt} in 73 | c ) 74 | cemuzip=$OPTARG 75 | if [ ! -f "$cemuzip" ]; then 76 | echo "cemu zip doesn't exist" 77 | exit 1 78 | fi 79 | ;; 80 | h ) 81 | cemuhookzip=$OPTARG 82 | if [ ! -f "$cemuhookzip" ]; then 83 | echo "cemuhook zip doesn't exist" 84 | exit 1 85 | fi 86 | ;; 87 | a ) 88 | downloadlatest 89 | ;; 90 | f ) 91 | skipgfxcheck=1 92 | ;; 93 | i ) 94 | instdir=$OPTARG 95 | ;; 96 | \? ) 97 | printhelp 98 | ;; 99 | : ) 100 | echo "Invalid option: $OPTARG requires an argument" 1>&2 101 | printhelp 102 | ;; 103 | esac 104 | done 105 | shift $((OPTIND -1)) 106 | skipgfxcheck=1 107 | #check gfx package vers 108 | if [[ "$skipgfxcheck" == "" ]]; then 109 | checkgfxver 110 | fi 111 | 112 | #Set opts if unset 113 | if [[ "$instdir" == "" ]]; then 114 | instdir=$HOME/.cemu 115 | fi 116 | if [[ "$cemuzip" == "" ]]; then 117 | cemuzip=cemutemp.zip 118 | fi 119 | if [[ "$cemuhookzip" == "" ]]; then 120 | cemuhookzip=cemuhooktemp.zip 121 | fi 122 | if [[ "$sharedFonts" == "" ]]; then 123 | sharedFonts=sharedFonts.zip 124 | fi 125 | 126 | #Extract zips 127 | echo "Extracting zips" 128 | mkdir -p $instdir 129 | 130 | 131 | #Unpack downloaded zips if applicable 132 | if [ -f "$cemuzip" ]; then 133 | bsdtar -xf "$cemuzip" -s'|[^/]*/||' -C $instdir 134 | fi 135 | if [ -f "$cemuhookzip" ]; then 136 | unzip -q -o "$cemuhookzip" -d $instdir 137 | fi 138 | if [ -f "$sharedFonts" ]; then 139 | unzip -q -o "$sharedFonts" -d $instdir 140 | fi 141 | 142 | #Delete downloaded zips if applicable 143 | 144 | if [ -f "cemutemp.zip" ]; then 145 | rm -rf cemutemp.zip 146 | fi 147 | if [ -f "cemuhooktemp.zip" ]; then 148 | rm -rf cemuhooktemp.zip 149 | fi 150 | 151 | if [ -f "sharedFonts.zip" ]; then 152 | rm -rf sharedFonts.zip 153 | fi 154 | 155 | #Configure wine prefix 156 | echo "Configuring new wine prefix" 157 | export WINEPREFIX=$(realpath $instdir)/wine 158 | winetricks -q vcrun2017 159 | winetricks settings win7 160 | 161 | #Create cemuhook.ini, enabling cemuhook h264 as default 162 | cat > $instdir/cemuhook.ini << EOF1 163 | [Debug] 164 | useH264Decoder = true 165 | EOF1 166 | 167 | #Create launch scripts 168 | cat > LaunchCEMU << EOF1 169 | #!/bin/bash 170 | export WINEPREFIX="$(realpath $instdir)/wine" 171 | #for cemuhook 172 | export WINEDLLOVERRIDES="mscoree=;mshtml=;dbghelp.dll=n,b" 173 | 174 | cd $(realpath $instdir) 175 | mesa_glthread=true __GL_THREADED_OPTIMIZATIONS=1 vblank_mode=0 WINEESYNC=1 wine Cemu.exe "\$@" 176 | EOF1 177 | chmod +x LaunchCEMU 178 | 179 | cat > LaunchCEMUgcn3BOTW << EOF1 180 | #!/bin/bash 181 | export WINEPREFIX="$(realpath $instdir)/wine" 182 | #for cemuhook 183 | export WINEDLLOVERRIDES="mscoree=;mshtml=;dbghelp.dll=n,b" 184 | 185 | cd $(realpath $instdir) 186 | R600_DEBUG=nohyperz mesa_glthread=true vblank_mode=0 WINEESYNC=1 wine Cemu.exe "\$@" 187 | EOF1 188 | chmod +x LaunchCEMUgcn3BOTW 189 | 190 | echo "Successfully installed to $(realpath $instdir)" 191 | echo "You may now run CEMU with LaunchCEMU written in this directory" 192 | echo "You may place LaunchCEMU anywhere, and even pass arguments to it just like Cemu.exe on Windows" 193 | echo "Note2: gcn3 (radeon 300-500 series) users should use the gcn3BOTW script for launching BOTW" 194 | echo "Note3: CEMU versions >= 1.15.4 utilize a built-in solution for in-game video playback. Turn on Debug -> 'Use CemuHook H264' if you are encountering any green screens." 195 | -------------------------------------------------------------------------------- /sharedFonts.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CEMULinux/cemutil/5ae1f324fd9c9328046c2f295608bf72c11e62a0/sharedFonts.zip -------------------------------------------------------------------------------- /ubuntu-wine.sh: -------------------------------------------------------------------------------- 1 | if [ -z "$DISPLAY" ]; then 2 | export DISPLAY=:0.0 3 | fi 4 | 5 | if ! $(lsb_release -a | grep -q -e "18.04" -e "18.10" -e "19.04" -e "19.10" -e "20.04"); then 6 | echo "You need at least Ubuntu 18.04" 7 | exit 1 8 | fi 9 | 10 | # add i386 architecture, necessary for wine 11 | sudo dpkg --add-architecture i386 12 | 13 | # download wine repo key 14 | sudo wget -nc https://dl.winehq.org/wine-builds/winehq.key 15 | 16 | # add wine repo key 17 | sudo apt-key add winehq.key 18 | 19 | if $(lsb_release -a | grep -q -e "18.04"); then 20 | sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' 21 | fi 22 | 23 | if $(lsb_release -a | grep -q -e "18.10"); then 24 | sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main' 25 | fi 26 | 27 | if $(lsb_release -a | grep -q -e "19.04"); then 28 | sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ disco main' 29 | fi 30 | 31 | if $(lsb_release -a | grep -q -e "19.10"); then 32 | sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main' 33 | fi 34 | 35 | if $(lsb_release -a | grep -q -e "20.04"); then 36 | sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' 37 | fi 38 | 39 | sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport -y 40 | 41 | sudo apt update 42 | 43 | # install wine-staging 44 | sudo apt -y install --install-recommends winehq-staging 45 | 46 | # install winetricks 47 | sudo apt -y install winetricks 48 | 49 | #cleanup 50 | sudo rm -rf winehq.key 51 | --------------------------------------------------------------------------------