Changeset 594 for AE/installer2/src/net/oni2/aeinstaller/backend
- Timestamp:
- Jan 1, 2013, 8:27:17 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/backend
- Files:
-
- 6 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/Settings.java
r591 r594 10 10 import java.net.URLDecoder; 11 11 import java.util.HashMap; 12 import java.util.Vector; 13 14 import net.oni2.aeinstaller.backend.app_launcher.QuickAppExecution; 12 15 13 16 import com.thoughtworks.xstream.XStream; … … 26 29 * @author Christian Illy 27 30 */ 31 public enum Architecture { 32 /** 33 * 32 bit 34 */ 35 X86, 36 /** 37 * 64 bit 38 */ 39 AMD64 40 }; 41 42 /** 43 * @author Christian Illy 44 */ 28 45 public enum Platform { 29 46 /** … … 75 92 public static boolean getDebug() { 76 93 return debugRun; 94 } 95 96 /** 97 * @return Processor architecture 98 */ 99 public static Architecture getArchitecture() { 100 switch (getPlatform()) { 101 case WIN: 102 String arch = System.getenv("PROCESSOR_ARCHITECTURE") 103 .toLowerCase(); 104 if (arch.startsWith("x86")) 105 return Architecture.X86; 106 return Architecture.AMD64; 107 case MACOS: 108 case LINUX: 109 Vector<String> cmd = new Vector<String>(); 110 cmd.add("getconf"); 111 cmd.add("LONG_BIT"); 112 Vector<String> res = null; 113 try { 114 res = QuickAppExecution.execute(cmd); 115 } catch (IOException e) { 116 // TODO Auto-generated catch block 117 e.printStackTrace(); 118 } 119 if (res != null) { 120 if (res.get(0).equals("64")) 121 return Architecture.AMD64; 122 } 123 return Architecture.X86; 124 default: 125 return null; 126 } 77 127 } 78 128
Note:
See TracChangeset
for help on using the changeset viewer.