Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Autor : Inukaze ( From 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 Arquitecturaivos 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 :
- # Este Script es para Solucionar problemas de Directx
- # Para el Software que esta Intentado Ejecutar
- # Como NATIVO de un SISTEMA QUE NO ES WINDOWS
- # Definir el directorio actual , como el principal
- # del juego o programa
- RUTA=""$( cd -P "$( dirname "$" )" && pwd )""
- RUTA_DEL_SOFTWARE="$RUTA"/wine/data/drive_c/software
- # Obtener el nombre del nucleo del sistema
- Nucleo=$(uname -s)
- if [ $Nucleo = "Darwin" ]; then
- Nucleo=mac
- elif [ $Nucleo = "Linux" ]; then
- Nucleo=linux
- elif [ $Nucleo = "FreeBSD" ]; then
- Nucleo=linux
- elif [ $Nucleo = "OpenSolaris" ]; then
- Nucleo=linux
- else
- echo "Sistema Operativo NO SOPORTADO"
- fi
- # Determinando la arquitectura de la maquina
- Arquitectura=$(uname -m)
- if [ $Arquitectura = "i386" ]; then
- PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
- export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
- export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- Arquitectura="32 Bits"
- elif [ $Arquitectura = "i486" ]; then
- PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
- export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
- export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- Arquitectura="32 Bits"
- elif [ $Arquitectura = "i586" ]; then
- PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
- export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
- export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- Arquitectura="32 Bits"
- elif [ $Arquitectura = "i686" ]; then
- PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
- export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
- export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- Arquitectura="32 Bits"
- elif [ $Arquitectura = "x86_64" ]; then
- PATH="$PWD/wine/$Nucleo/x86_64/bin:$PATH"
- export WINESERVER="$PWD/wine/$Nucleo/x86_64/bin/wineserver"
- export WINELOADER="$PWD/wine/$Nucleo/x86_64/bin/wine"
- export WINEPREFIX="$PWD/wine/data"
- export WINEDEBUG=-all
- Arquitectura="64 Bits"
- else
- echo "Arquitectura NO SOPORTADA"
- fi
- # Muestra en la terminal La arquitectura &
- # La version especifica de Wine usada
- Version_De_Wine=$(wine --version)
- echo ""
- echo ""
- echo "Corriendo '$Version_De_Wine' en '$Nucleo' ( Maquina de '$Arquitectura' )"
- echo ""
- echo ""
- # Solucion de Resolucion - Parte 1
- 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
- # Solucion de Resolucion - Parte 1
- # Modo Ventana/Pantalla Completa :
- echo "REGEDIT4" >> modo_ventana.reg
- echo "" >> modo_ventana.reg
- echo "[HKEY_CURRENT_USER\Software\Wine\Explorer]" >> modo_ventana.reg
- echo '"Desktop"="Default"' >> modo_ventana.reg
- echo "" >> modo_ventana.reg
- echo "[HKEY_CURRENT_USER\Software\Wine\Explorer\Desktops]" >> modo_ventana.reg
- # Para Activar el Modo Ventana :
- #echo '"Default"'='"'"$RES"'"' >> modo_ventana.reg
- # Para DesActivar el Modo Ventana :
- echo '"Default"'='"'""'"' >> modo_ventana.reg
- regedit -s modo_ventana.reg
- rm -rf modo_ventana.reg
- killall -9 services.exe winedevice.exe plugplay.exe explorer.exe wineboot.exe dplaysvr.exe winemenubuilder
- # Modo Ventana/Pantalla Completa :
- export SDL_MOUSE_RELATIVE=1
- export SDL_VIDEO_X11_DGAMOUSE=1
- cd "$RUTA"/arreglos
- echo "Registrando Arreglos segun el Sistema $Nucleo" ; regedit -s "$Nucleo"_video.reg ; regedit -s "$Nucleo"_sonido.reg
- # Extraer la cantidad de MB de video
- tvid=$(lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)M\]/\1/p')
- # Dividir los MB de video totales
- # Depende del Juego usado en Wine
- # Siempre dividir por un Numero PAR
- # Para evitar errores
- # utiliza ; 2 , 4 , 8 , 16 , 32 .
- let "mvid"=$tvid/2
- echo 'REGEDIT4' >> video.reg
- echo '' >> video.reg
- echo '[HKEY_CURRENT_USER\Software\Wine\Direct3D]' >> video.reg
- echo '"VideoMemorySize"'='"'"$mvid"'"' >> video.reg
- regedit -s video.reg && rm -rf video.reg
- #PULSE=$(ps -A|grep pulse|awk '{print $4}')
- #PULSEAUDIO=$(ps -A|grep pulseaudio|awk '{print $4}')
- #
- #if [ "$PULSE" = "pulse" ]; then
- # `pulse --kill --cleanup-shm` &
- # `pulse --kill --cleanup-shm` &
- #fi
- #if [ "$PULSEAUDIO" = "pulseaudio" ]; then
- # `pulseaudio --kill --cleanup-shm` &
- # `pulseaudio --kill --cleanup-shm` &
- #fi
- echo "Informacion :"
- echo "Arquitectura -> `uname -m` ($Arquitectura) "
- echo "DEBUG -> $WINEDEBUG "
- echo "Prefijo -> $WINEPREFIX"
- echo "Cargador -> $WINELOADER"
- echo "Servidor -> $WINESERVER"
- echo ""
- echo ""
- echo "$RUTA"
- echo "RUTA -> $RUTA_DEL_SOFTWARE"
- cd "$RUTA_DEL_SOFTWARE"
- echo ""
- echo "Ejecutando el Software"
- echo "Ragnarok Online International " ; `wine "Ragnarok.exe"`
- echo ""
- echo ""
- killall -9 Iniciar wineserver services.exe winedevice.exe plugplay.exe explorer.exe winemenubuilder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement