Advertisement
djvj

Untitled

Oct 23rd, 2011
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; This replaces the batch files the emu comes with and does it all in ahk instead
  2. winVer := (InStr(ProgramFiles, "(x86)") ? ("64") : ("32")) ; check if windows is 32 or 64 bit
  3. javaVer := FileExist(A_WinDir . "\SysWOW64") ; check if java is 32 or 64 bit
  4. If ( emuBit = "64" && winVer = "32" )
  5.     ScriptError("Unable to run a 64bit Java on a 32bit Windows. Install a 64bit version of Windows first or use a 32bit Java.")
  6. If ( emuBit = "64" && !javaVer )
  7.     ScriptError("Java 64bit is not installed.")
  8. javaKey := ("SOFTWARE\" (If javaVer ? ("Wow6432Node\") : ("")) "JavaSoft\Java Runtime Environment") ; if true, we should have java 64bit installed, else 32bit, set appropriate reg location
  9. RegRead, javaVersion, HKEY_LOCAL_MACHINE, %javaKey%, CurrentVersion ; read java's current version #
  10. RegRead, javaDir, HKEY_LOCAL_MACHINE, %javaKey%\%javaVersion%, JavaHome ; read java's install location
  11. javaExe = %javaDir%\bin\java.exe
  12. IfNotExist, %javaExe%
  13.     ScriptError("Could not find java.exe. Try reinstalling the java version you want to use.")
  14.  
  15.  
  16.  
  17. If ( emuBit = "32" )
  18.     Run, CMD "%javaExe%", -Xmx%useRAM%m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=64m -Djava.library.path=lib/windows-x86 -jar bin/jpcsp.jar `%*, %emupath%, UseErrorLevel
  19. Else if ( emuBit = "64" )
  20.     Run, "%javaExe%", -Xmx%useRAM%m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=64m -Djava.library.path=lib/windows-amd64 -jar bin/jpcsp.jar `%*, %emupath%, UseErrorLevel
  21. Else
  22.     ScriptError("Please set emuBit to either 32 or 64. This reflects the version of the emulator you want to run")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement