Advertisement
Guest User

Untitled

a guest
Oct 10th, 2011
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. package de.onyxbits.spiralspy;
  2. import java.io.*;
  3. import javax.swing.*;
  4. import com.threerings.opengl.*;
  5. import com.threerings.opengl.model.tools.*;
  6. import com.threerings.util.*;
  7.  
  8.  
  9. public class SpyApp implements Runnable {
  10.  
  11.  
  12. public static void main(String[] args) throws Exception{
  13. new Thread(new SpyApp()).start();
  14. }
  15.  
  16. public void run() {
  17. // Are we in the right directory?
  18. File test = new File(new File("code"),"projectx-pcode.jar");
  19. if (!test.exists()) {
  20. JOptionPane.showMessageDialog(null,"Please put the Jar into the SpiralKnights directory");
  21. System.exit(1);
  22. }
  23.  
  24. String psep=System.getProperty("path.separator");
  25. StringBuilder sb = new StringBuilder(System.getProperty("java.home"));
  26. sb.append(File.separator);
  27. sb.append("bin");
  28. sb.append(File.separator);
  29. sb.append("java");
  30. File jvm = new File(sb.toString());
  31. if (! jvm.exists()) {
  32. // Guess which OS we are on...
  33. sb.append(".exe");
  34. psep=";";
  35. }
  36.  
  37. String ver = Package.getPackage("de.onyxbits.spiralspy").getImplementationVersion();
  38. String cpath="spiralspy-"+ver+".jar"+psep+"code"+File.separator+"lwjgl.jar"+psep+"code"+File.separator+"projectx-config.jar"+psep+"code"+File.separator+"projectx-pcode.jar"+psep+".";
  39.  
  40. File rsrcdir = new File(new File(System.getProperty("user.dir")),"rsrc");
  41. ResourceUtil.setPreferredResourceDir(rsrcdir.getAbsolutePath());
  42.  
  43. try {
  44. ProcessBuilder builder = new ProcessBuilder(sb.toString(),"-Djava.library.path=native","-cp",cpath,"com.threerings.opengl.model.tools.ModelViewer","rsrc"+File.separator+"character"+File.separator+"pc"+File.separator+"model.dat");
  45. builder.start();
  46. }
  47. catch (Exception exp) {
  48. exp.printStackTrace();
  49. }
  50.  
  51. }
  52. }
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement