#!/bin/bash # # Future Pinball v1.6b.20061029 install script # Script version 0.9.39 (2007-06-19) by LvR # Get lastest version at http://fprelease.free.fr/fpwine/ # # Changelog : # v0.9.39 : First release # # Script Configuration winePrefix="$HOME/.fpwine" nativeOle="n" nativeCrypt="n" urlDcom="http://download.microsoft.com/download/d/1/3/d13cd456-f0cf-4fb2-a17f-20afc79f8a51/DCOM98.EXE" urlFP="http://www.futurepinball.com/downloads/FuturePinballSetup_v1.6b.20061029.exe" urlMfc="http://fprelease.free.fr/fpwine/dlls/mfc42.dll" urlCrypt="http://fprelease.free.fr/fpwine/dlls/crypt32.dll" urlRsa="http://fprelease.free.fr/fpwine/dlls/rsaenh.dll" urlVB="http://fprelease.free.fr/fpwine/dlls/vbscript.dll" # Some usefull functions execute() { eval $1 if [ "$?" != "0" ] then echo -n "Error : can't execute '$1'" if [ -z "$2" ] then echo else echo ", $2" fi exit 1 fi } download() { if [ ! -r "$1" ] then if [ "$auto" = "n" ] then echo -n "Can't find $1, try to download it ? [Y/n] : " read answer else answer="" fi if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ] then wget "$2" if [ "$?" != "0" ] then echo "error : can't download $1" else echo "$1 successfully downloaded" fi fi fi } # Disclaimer echo "-----------------------------------------------------------" echo " Future Pinball v1.6b.20061029 install script" echo " Script version 0.9.39 (2007-06-19) by LvR" echo " Get lastest version at http://fprelease.free.fr/fpwine/" echo "-----------------------------------------------------------" echo " Configured for wine 0.9.39" echo " With older version, use --noauto switch and install " echo " native crypto dlls" echo "-----------------------------------------------------------" # Help if [ "$1" = "--help" ] then echo " Usage :" echo " `basename $0` [--help] [-n] [--noauto]" echo " Options :" echo " -n,--noauto : ask user for installing some components, " echo " mainly for testing FP with differents" echo " wine versions/configurations" echo " --help : display this help" echo "-----------------------------------------------------------" exit 0 fi # Automatic installation ? if [ "$1" = "--noauto" ] || [ "$1" = "-n" ] then auto="n" else auto="y" fi # Check if wine is installed echo echo -n "Checking wine version : " execute 'wine --version' 'you must install wine before installing Future Pinball' # Check if 3d acceleration is ok execute 'accel=`glxinfo | grep "direct rendering" | cut -d ":" -f2`' accel=`echo $accel` #trim accel echo echo -n "Checking 3D acceleration : " if [ "$accel" = "Yes" ] then echo "ok" else echo "not found" echo "Error : you need 3D acceleration activated to run Future Pinball." exit 1 fi # Choose wine prefix echo if [ "$auto" = "n" ] then echo -n "Enter wine prefix [$winePrefix] : " read answer else answer="" fi if [ -z "$answer" ] then echo "Using default prefix : $winePrefix" else winePrefix="$answer" echo "Using prefix : $winePrefix" fi # Delete previous wine root echo if [ "$auto" = "n" ] then echo -n "Delete old $winePrefix directory [Y/n] : " read answer else answer="" fi if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ] then rm -rf "$winePrefix" echo "$winePrefix deleted" fi # Initialize wineprefix execute "WINEPREFIX=$winePrefix wineprefixcreate" echo "$winePrefix initialized" # Install native OLE echo if [ "$auto" = "n" ] then echo -n "Install native ole dlls [Y/n] : " read answer else answer="" fi if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ] then download "`basename $urlDcom`" "$urlDcom" if [ ! -r "DCOM98.EXE" ] then echo "Error : needed DCOM98.EXE not found. Please download it and retry" exit 1 fi echo "Installing DCOM98.EXE ..." echo 'REGEDIT4' > win98.reg echo '' >> win98.reg echo '[HKEY_CURRENT_USER\Software\Wine]' >> win98.reg echo '"Version"="win98"' >> win98.reg execute "WINEPREFIX=$winePrefix wine regedit win98.reg" execute "rm $winePrefix/drive_c/windows/system32/ole32.dll" execute "rm $winePrefix/drive_c/windows/system32/oleaut32.dll" execute "rm $winePrefix/drive_c/windows/system32/olepro32.dll" execute "rm $winePrefix/drive_c/windows/system32/rpcrt4.dll" # TODO it fails, see why ? # execute "WINEPREFIX=$winePrefix WINEDLLOVERRIDES=ole32=n wine DCOM98.EXE /Q" WINEPREFIX=$winePrefix WINEDLLOVERRIDES=ole32=n wine DCOM98.EXE /Q nativeOle="y" fi # Install native crypto dlls echo if [ "$auto" = "n" ] then echo -n "Install natives crypto dlls [y/N] : " read answer else answer="" fi if [ "$answer" = "Y" ] || [ "$answer" = "y" ] then download "`basename $urlCrypt`" "$urlCrypt" if [ ! -r "crypt32.dll" ] then echo "Error : needed crypt32.dll. Please download it and retry" exit 1 fi download "`basename $urlRsa`" "$urlRsa" if [ ! -r "rsaenh.dll" ] then echo "Error : needed crypt32.dll. Please download it and retry" exit 1 fi echo "Installing natives crypt32.dll and rsaenh.dll ..." execute "cp crypt32.dll $winePrefix/drive_c/windows/system32/" execute "cp rsaenh.dll $winePrefix/drive_c/windows/system32/" nativeCrypt="y" fi # Install mfc42.dll echo download "`basename $urlMfc`" "$urlMfc" if [ ! -r "mfc42.dll" ] then echo "Error : needed mfc42.dll not found. Please download it and retry" exit 1 fi echo "Installing mfc42.dll ..." execute "cp mfc42.dll $winePrefix/drive_c/windows/system32/" # Install VBScript.dll echo download "`basename $urlVB`" "$urlVB" if [ ! -r "vbscript.dll" ] then echo "Error : needed vbscript.dll not found. Please download it and retry" exit 1 fi echo "Installing vbscript.dll ..." execute "cp vbscript.dll $winePrefix/drive_c/windows/system32/" execute "WINEPREFIX=$winePrefix wine regsvr32 VBScript" # Set winxp compatibility echo echo "Setting windows XP compatibility" echo 'REGEDIT4' > winxp.reg echo '' >> winxp.reg echo '[HKEY_CURRENT_USER\Software\Wine]' >> winxp.reg echo '"Version"="winxp"' >> winxp.reg execute "WINEPREFIX=$winePrefix wine regedit winxp.reg" # Disable sound echo echo "Setting no sound ..." echo "Future Pinball doesn't work yet with sound in wine." echo "The winecfg control panel will be opened, please go to 'audio' tab and uncheck all sound drivers." echo -n "Press [Enter] to continue : " read dummy execute "WINEPREFIX=$winePrefix winecfg" # Install Future Pinball echo download "`basename $urlFP`" "$urlFP" if [ ! -r "FuturePinballSetup_v1.6b.20061029.exe" ] then echo "Error : needed FuturePinballSetup_v1.6b.20061029.exe not found. Please download it and retry" exit 1 fi echo "Installing Future Pinball ..." execute "WINEPREFIX=$winePrefix wine FuturePinballSetup_v1.6b.20061029.exe" # Create FP launcher echo '#!/bin/bash' > runFP echo '' >> runFP dllOverride="" if [ "$nativeCrypt" = "y" ] || [ "$nativeOle" = "y" ] then dllOverride="WINEDLLOVERRIDES=" if [ "$nativeCrypt" = "y" ] then dllOverride="${dllOverride}crypt32,rsaenh" fi if [ "$nativeCrypt" = "y" ] && [ "$nativeOle" = "y" ] then dllOverride="${dllOverride}," fi if [ "$nativeOle" = "y" ] then dllOverride="${dllOverride}ole32,oleaut32" fi dllOverride="${dllOverride}=n " fi echo "WINEPREFIX=$winePrefix WINEDEBUG=-all ${dllOverride}wine $winePrefix/drive_c/\"Program Files\"/\"Future Pinball\"/\"Future Pinball.exe\"" >> runFP echo '#!/bin/bash' > debugFP echo '' >> debugFP echo 'logFile=`date -u "+%Y%m%d_%H%M%S"`' >> debugFP echo 'touch "fp_$logFile.out"' >> debugFP echo "WINEPREFIX=$winePrefix WINEDEBUG=+loaddll ${dllOverride}wine $winePrefix/drive_c/\"Program Files\"/\"Future Pinball\"/\"Future Pinball.exe\" &> fp_\$logFile.out & tail -f fp_\$logFile.out" >> debugFP execute 'chmod +x runFP' execute 'chmod +x debugFP' # End of script echo echo "Installation done !" echo "You can run Future Pinball with runFP command" echo