Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Autor : Inukaze ( Venezuela )
- # Sitio : http://inukaze.wordpress.com
- # Correo-E : inukaze.otaku@gmail.com
- # Licensia : GPL 3
- #
- # Acerca de este Script :
- #
- # Yo intento escribir Scripts compatibles con
- # Sistemas Operativos Unix & Posix , y cualquier
- # Sistema Operativo que soporte versiones de la API
- # conocida como "Wine" o "WineHQ" para poder ejecutar
- # software de Microsoft Windows , sin necesidad de su
- # sistema operativo , y crear paquetes autocontenidos
- # para sistemas operativos como por ejemplo :
- # Linux , FreeBSD , OpenSolaris
- # Unix , BSD , Solaris , MacOS
- # Usando versiones pre-compiladas , para arquitecturas
- # como x86 & x86_64 (32 Bits & 64 Bits ) con versiones
- # Especificas de Wine/WineHQ y los archivos oficiales
- # para "Windows" para una mayor compatibilidad usando
- # los requisitos de Sistema Originales y que esto pueda
- # ser aprovechado , por Juegos , Programas , Software
- # Ahora apartir de aqui comienza mi Script :
- # Definir el directorio actual , como el principal
- # del juego o programa
- GamePath=""$( cd -P "$( dirname "$" )" && pwd )""
- rm -rf "$GamePath/wine/data/drive_c/users"
- rm -rf "$GamePath/wine/data/drive_c/windows"
- rm -rf "$GamePath/wine/data/Program Files (x86)"
- rm -rf "$GamePath/wine/data/Program Files"
- rm -rf "$GamePath/wine/data/drive_c/Archivos de programa"
- rm -rf "$GamePath/wine/data/drive_c/Program Files (x86)"
- rm -rf "$GamePath/wine/data/drive_c/Program Files"
- rm -rf "$GamePath/wine/data/system.reg"
- rm -rf "$GamePath/wine/data/user.reg"
- rm -rf "$GamePath/wine/data/userdef.reg"
- rm -rf "$GamePath/wine/data/dosdevices"
- rm -rf "$GamePath/wine/data/.update-timestamp"
- rm -rf "$GamePath/wine/.DS_Store"
- rm -rf "$GamePath/wine/linux/.DS_Store"
- rm -rf "$GamePath/wine/linux/x86/.DS_Store"
- rm -rf "$GamePath/wine/linux/x86_64/.DS_Store"
- rm -rf "$GamePath/wine/linux/x86/bin/.DS_Store"
- rm -rf "$GamePath/wine/linux/x86_64/bin/.DS_Store"
- rm -rf "$GamePath/wine/mac/.DS_Store"
- rm -rf "$GamePath/wine/mac/x86/.DS_Store"
- rm -rf "$GamePath/wine/mac/x86_64/.DS_Store"
- rm -rf "$GamePath/wine/mac/x86/bin/.DS_Store"
- rm -rf "$GamePath/wine/mac/x86_64/bin/.DS_Store"
- rm -rf "$GamePath"/wine/data/cachedmetrics.\:0
- # Obtener el nombre del nucleo del sistema
- kernel=$(uname -s)
- if [ $kernel = "Darwin" ]; then
- kernel=mac
- elif [ $kernel = "Linux" ]; then
- kernel=linux
- else
- echo "Sistema Operativo NO SOPORTADO"
- fi
- # Determinando la arquitectura de la maquina
- arch=$(uname -m)
- if [ $arch = "i386" ]; then
- PATH="$PWD/wine/$kernel/x86/bin:$PATH"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- arch="32 Bits"
- elif [ $arch = "i486" ]; then
- PATH="$PWD/wine/$kernel/x86/bin:$PATH"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- arch="32 Bits"
- elif [ $arch = "i586" ]; then
- PATH="$PWD/wine/$kernel/x86/bin:$PATH"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- arch="32 Bits"
- elif [ $arch = "i686" ]; then
- PATH="$PWD/wine/$kernel/x86/bin:$PATH"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- arch="32 Bits"
- elif [ $arch = "x86_64" ]; then
- PATH="$PWD/wine/$kernel/x86_64/bin:$PATH"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- arch="64 Bits"
- else
- echo "Arquitectura NO SOPORTADA"
- fi
- # Muestra en la terminal La arquitectura &" >> "$GamePath"/Iniciar
- # La version especifica de Wine usada" >> "$GamePath"/Iniciar
- wver=$(wine --version)
- echo ""
- echo ""
- echo "Corriendo $wver en $kernel ( Maquina de $arch )"
- echo ""
- echo ""
- # Guardar la resolucion Actual :
- echo `xrandr --current | grep current | awk '{print $8}'` >> RES1
- echo `xrandr --current | grep current | awk '{print $10}'` >> RES2
- cat RES2 | sed -i 's/,//g' RES2
- P1RES=$(cat RES1)
- P2RES=$(cat RES2)
- rm RES1 RES2
- echo "$P1RES"'x'"$P2RES" >> RES
- RES=$(cat RES)
- rm RES
- # Resolucion Actual Guardada.
- echo 'REGEDIT4' >> audio.reg
- echo '' >> audio.reg
- echo '[HKEY_CURRENT_USER\Software\Wine\DirectSound]' >> audio.reg
- echo '"DefaultSampleRate"="48000"' >> audio.reg
- echo '"HardwareAcceleration"="Emulation"' >> audio.reg
- regedit -s audio.reg
- rm audio.reg
- # Arreglo de Video para evitar errores graficos
- tvid=$(lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)M\]/\1/p')
- let "mvid"="$tvid"/2
- echo "REGEDIT4" >> "$GamePath"/video.reg
- echo "[HKEY_CURRENT_USER\Software\Wine\Direct3D]" >> "$GamePath"/video.reg
- echo '"DirectDrawRenderer"="gdi"' >> "$GamePath"/video.reg
- echo '"OffscreenRenderingMode"="backbuffer"' >> "$GamePath"/video.reg
- echo '"VideoMemorySize"'='"'"$mvid"'"' >> "$GamePath"/video.reg
- wine regedit -s "$GamePath"/video.reg
- rm "$GamePath"/video.reg
- # Arreglo de Video para evitar errores graficos
- # Instalar Arreglos para el Correcto Funcionamiento
- # Del Software a usar :
- cd "$GamePath"/wine/data/drive_c/software/lib
- cp -rf scrrun.dll "$GamePath"/wine/data/drive_c/windows/system32/
- cp -rf usp10.dll "$GamePath"/wine/data/drive_c/windows/system32/
- cp -rf vbscript.dll "$GamePath"/wine/data/drive_c/windows/system32/
- ############################ Videos : ###############################
- #~½¬{cp -rf qasf.dll "$GamePath"/wine/data/drive_c/windows/system32/
- #~½¬{cp -rf wmasf.dll "$GamePath"/wine/data/drive_c/windows/system32/
- #~½¬{cp -rf wmvcore.dll "$GamePath"/wine/data/drive_c/windows/system32/
- #~½¬{cp -rf wmvdecod.dll "$GamePath"/wine/data/drive_c/windows/system32/
- #~½¬{cp -rf wmvd mod.dll "$GamePath"/wine/data/drive_c/windows/system32/
- #~½¬{cp -rf wmvsdecd.dll "$GamePath"/wine/data/drive_c/windows/system32/
- ########################## Registro ###############################
- echo "REGEDIT4" >> arreglos.reg
- echo "" >> arreglos.reg
- echo "[HKEY_CURRENT_USER\Software\Wine\DllOverrides]" >> arreglos.reg
- echo '"scrrun"="native, builtin"' >> arreglos.reg
- echo '"usp10"="native, builtin"' >> arreglos.reg
- echo '"vbscript"="native, builtin"' >> arreglos.reg
- #################### Registro - Videos : ############################
- #~½¬{echo '"msimg32.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"msvfw32.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"qasf.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"wmasf.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"wmvcore.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"wmvdecod.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"wmvdmod.dll"="native, builtin"' >> arreglos.reg
- #~½¬{echo '"wmvsdecd.dll"="native, builtin"' >> arreglos.reg
- regedit -s arreglos.reg
- rm -rf arreglos.reg
- cd "$GamePath"/wine/data/drive_c/windows/system32
- regsvr32 atl.dll
- regsvr32 scrrun.dll
- regsvr32 vbscript.dll
- # Matar a PulseAudio si esta en ejecucion
- #~½¬{paeudua=`ps -A | grep pulseaudio | awk '{print $4}'`
- #~½¬{if [ $paeudua = "pulseaudio" ]; then
- #~½¬{ killall -9 pulseaudio
- #~½¬{ echo `ps -A | grep pulseaudio | awk '{print $1}'` >> ID1
- #~½¬{ PID1=$(cat ID1)
- #~½¬{ rm -rf ID1
- #~½¬{ kill -s TERM $PID1
- #~½¬{ echo "PulseAudio Terminado"
- #~½¬{else
- #~½¬{ echo "PulseAudio no se esta ejecutando"
- #~½¬{fi
- # Detectar si en el archivo de configuracion
- # del Juego esta defino usar "Pantalla Completa"
- # o no. Si se usa a Pantalla Completa bajar
- # La Resolucion a 640x480 , Iniciar el software
- # Luego de finalizar , Restaurar la resolucion
- cd "$GamePath"/wine/data/drive_c/software
- mdv=`cat config.ini | grep FullScreen= | cut -d " " -f03 | sed 's/^[FullScreen= \t]*//' | sed 's/^[mdv= \t]*//'`
- typeset -i str
- if [ "${mdv}" = "1" ]; then
- echo "Modo Pantalla Completa : ""$mdv"
- else
- mdv=`expr $mdv - 1`
- echo "Modo Ventana : ""$mdv"
- fi
- #~½¬{ echo "Modo Pantalla Completa"
- #~½¬{ CEUJA=$(ps -A | grep compiz | awk '{print $4}')
- #~½¬{ if [ $CEUJA = "compiz" ]; then
- #~½¬{ echo ""
- #~½¬{ echo "Detectado Compiz en ejecucion"
- #~½¬{ echo "El Juego se ejecutara en la resolucion"
- #~½¬{ echo "640x480 para su correcto funcionamiento"
- #~½¬{ echo "Tu resolucion actual $RES sera restaurada"
- #~½¬{ echo "al Finalizar"
- #~½¬{ `xrandr -s 640x480`
- #~½¬{ wine "Koumajou.exe"
- #~½¬{ `xrandr -s $RES`
- #~½¬{ else
- #~½¬{ echo "Compiz no esta en uso"
- #~½¬{ echo "Modo Ventana"
- #~½¬{ wine "Koumajou.exe"
- #~½¬{ fi
- #~½¬{ echo ""
- #~½¬{ echo "No se comprobo si compiz esta en uso"
- #~½¬{ wine "Koumajou.exe"
- #~½¬{fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement