Advertisement
inukaze

iRO - Begin Script

Sep 9th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.04 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Autor :   Inukaze ( From Venezuela )
  4. # Sitio     :   http://inukaze.wordpress.com
  5. # Correo-E  :   inukaze.otaku@gmail.com
  6. # Licensia  :   GPL 3
  7. #
  8. # Acerca de este Script :  
  9. #
  10. # Yo intento escribir Scripts compatibles con
  11. # Sistemas Operativos Unix & Posix , y cualquier
  12. # Sistema Operativo que soporte versiones de la API
  13. # conocida como "Wine" o "WineHQ" para poder ejecutar
  14. # software de Microsoft Windows , sin necesidad de su
  15. # sistema operativo , y crear paquetes autocontenidos
  16. # para sistemas operativos como por ejemplo :
  17. # Linux , FreeBSD , OpenSolaris
  18. # Unix  , BSD     , Solaris     , MacOS
  19.  
  20. # Usando versiones pre-compiladas , para arquitecturas
  21. # como x86 & x86_64 (32 Bits & 64 Bits ) con versiones
  22. # Especificas de Wine/WineHQ y los Arquitecturaivos oficiales
  23. # para "Windows" para una mayor compatibilidad usando
  24. # los requisitos de Sistema Originales y que esto pueda
  25. # ser aprovechado , por Juegos , Programas , Software
  26. # Ahora apartir de aqui comienza mi Script :
  27.  
  28. # Este Script es para Solucionar problemas de Directx
  29. # Para el Software que esta Intentado Ejecutar
  30. # Como NATIVO de un SISTEMA QUE NO ES WINDOWS
  31.  
  32. # Definir el directorio actual , como el principal
  33. # del juego o programa
  34. RUTA=""$( cd -P "$( dirname "$" )" && pwd )""
  35. RUTA_DEL_SOFTWARE="$RUTA"/wine/data/drive_c/software
  36.  
  37. # Obtener el nombre del nucleo del sistema
  38. Nucleo=$(uname -s)
  39.  
  40. if      [ $Nucleo = "Darwin" ]; then
  41.         Nucleo=mac
  42. elif        [ $Nucleo = "Linux" ]; then
  43.         Nucleo=linux
  44. elif        [ $Nucleo = "FreeBSD" ]; then
  45.         Nucleo=linux
  46. elif        [ $Nucleo = "OpenSolaris" ]; then
  47.         Nucleo=linux
  48. else
  49.         echo "Sistema Operativo NO SOPORTADO"
  50. fi
  51.  
  52. # Determinando la arquitectura de la maquina
  53. Arquitectura=$(uname -m)
  54.  
  55. if         [ $Arquitectura = "i386" ]; then
  56.             PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
  57.             export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
  58.             export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
  59.             export WINEPREFIX="$PWD/wine/data"
  60.             export WINEDEBUG=-all
  61.             Arquitectura="32 Bits"
  62.     elif    [ $Arquitectura = "i486" ]; then
  63.             PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
  64.             export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
  65.             export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
  66.             export WINEPREFIX="$PWD/wine/data"
  67.             export WINEDEBUG=-all
  68.             Arquitectura="32 Bits"
  69.     elif    [ $Arquitectura = "i586" ]; then
  70.             PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
  71.             export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
  72.             export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
  73.             export WINEPREFIX="$PWD/wine/data"
  74.             export WINEDEBUG=-all
  75.             Arquitectura="32 Bits"
  76.     elif    [ $Arquitectura = "i686" ]; then
  77.             PATH="$PWD/wine/$Nucleo/x86/bin:$PATH"
  78.             export WINESERVER="$PWD/wine/$Nucleo/x86/bin/wineserver"
  79.             export WINELOADER="$PWD/wine/$Nucleo/x86/bin/wine"
  80.             export WINEPREFIX="$PWD/wine/data"
  81.             export WINEDEBUG=-all
  82.             Arquitectura="32 Bits"
  83.          elif [ $Arquitectura = "x86_64" ]; then
  84.             PATH="$PWD/wine/$Nucleo/x86_64/bin:$PATH"
  85.             export WINESERVER="$PWD/wine/$Nucleo/x86_64/bin/wineserver"
  86.             export WINELOADER="$PWD/wine/$Nucleo/x86_64/bin/wine"
  87.             export WINEPREFIX="$PWD/wine/data"
  88.             export WINEDEBUG=-all
  89.             Arquitectura="64 Bits"
  90.     else
  91.         echo "Arquitectura NO SOPORTADA"
  92. fi
  93.  
  94. # Muestra en la terminal La arquitectura &
  95. # La version especifica de Wine usada
  96. Version_De_Wine=$(wine --version)
  97. echo ""
  98. echo ""
  99. echo "Corriendo '$Version_De_Wine' en '$Nucleo' ( Maquina de '$Arquitectura' )"
  100. echo ""
  101. echo ""
  102.  
  103.  
  104. # Solucion de Resolucion - Parte 1
  105. echo `xrandr --current | grep current | awk '{print $8}'` >> RES1
  106. echo `xrandr --current | grep current | awk '{print $10}'` >> RES2
  107. cat RES2 | sed -i 's/,//g' RES2
  108. P1RES=$(cat RES1)
  109. P2RES=$(cat RES2)
  110. rm RES1 RES2
  111. echo "$P1RES"'x'"$P2RES" >> RES
  112. RES=$(cat RES)
  113. rm RES
  114. # Solucion de Resolucion - Parte 1
  115.  
  116. # Modo Ventana/Pantalla Completa :
  117. echo "REGEDIT4" >> modo_ventana.reg
  118. echo "" >> modo_ventana.reg
  119. echo "[HKEY_CURRENT_USER\Software\Wine\Explorer]" >> modo_ventana.reg
  120. echo '"Desktop"="Default"' >> modo_ventana.reg
  121. echo "" >> modo_ventana.reg
  122. echo "[HKEY_CURRENT_USER\Software\Wine\Explorer\Desktops]" >> modo_ventana.reg
  123.  
  124. # Para Activar el Modo Ventana :
  125. #echo '"Default"'='"'"$RES"'"' >> modo_ventana.reg
  126.  
  127. # Para DesActivar el Modo Ventana :
  128. echo '"Default"'='"'""'"' >> modo_ventana.reg
  129.  
  130. regedit -s modo_ventana.reg
  131. rm -rf modo_ventana.reg
  132. killall -9 services.exe winedevice.exe plugplay.exe explorer.exe wineboot.exe dplaysvr.exe winemenubuilder
  133. # Modo Ventana/Pantalla Completa :
  134.  
  135. export SDL_MOUSE_RELATIVE=1
  136. export SDL_VIDEO_X11_DGAMOUSE=1
  137.  
  138. cd "$RUTA"/arreglos
  139. echo "Registrando Arreglos segun el Sistema $Nucleo" ; regedit -s "$Nucleo"_video.reg ; regedit -s "$Nucleo"_sonido.reg
  140.  
  141. # Extraer la cantidad de MB de video
  142. tvid=$(lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)M\]/\1/p')
  143.  
  144. # Dividir los MB de video totales
  145. # Depende del Juego usado en Wine
  146. # Siempre dividir por un Numero PAR
  147. # Para evitar errores
  148. # utiliza ; 2 , 4 , 8 , 16 , 32 .
  149. let "mvid"=$tvid/2
  150. echo 'REGEDIT4' >> video.reg
  151. echo '' >> video.reg
  152. echo '[HKEY_CURRENT_USER\Software\Wine\Direct3D]' >> video.reg
  153. echo '"VideoMemorySize"'='"'"$mvid"'"' >> video.reg
  154. regedit -s video.reg && rm -rf video.reg
  155.  
  156. #PULSE=$(ps -A|grep pulse|awk '{print $4}')
  157. #PULSEAUDIO=$(ps -A|grep pulseaudio|awk '{print $4}')
  158. #
  159. #if [ "$PULSE" = "pulse" ]; then
  160. #   `pulse --kill --cleanup-shm` &
  161. #   `pulse --kill --cleanup-shm` &
  162. #fi
  163. #if [ "$PULSEAUDIO" = "pulseaudio" ]; then
  164. #   `pulseaudio --kill --cleanup-shm` &
  165. #   `pulseaudio --kill --cleanup-shm` &
  166. #fi
  167.  
  168. echo "Informacion :"
  169. echo "Arquitectura -> `uname -m` ($Arquitectura) "
  170. echo "DEBUG -> $WINEDEBUG "
  171. echo "Prefijo  -> $WINEPREFIX"
  172. echo "Cargador -> $WINELOADER"
  173. echo "Servidor -> $WINESERVER"
  174. echo ""
  175. echo ""
  176. echo "$RUTA"
  177. echo "RUTA -> $RUTA_DEL_SOFTWARE"
  178.  
  179. cd "$RUTA_DEL_SOFTWARE"
  180. echo ""
  181. echo "Ejecutando el Software"
  182. echo "Ragnarok Online International " ; `wine "Ragnarok.exe"`
  183. echo ""
  184. echo ""
  185.  
  186. killall -9 Iniciar wineserver services.exe winedevice.exe plugplay.exe explorer.exe winemenubuilder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement