Changeset 672 for AE/installer2/src/net/oni2/aeinstaller/backend/oni
- Timestamp:
- Feb 23, 2013, 6:40:47 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/oni/OniSplit.java
r624 r672 3 3 import java.io.File; 4 4 import java.io.IOException; 5 import java.lang.reflect.InvocationTargetException;6 import java.util.Map;7 5 import java.util.Vector; 8 6 7 import net.oni2.aeinstaller.backend.DotNet; 9 8 import net.oni2.aeinstaller.backend.Paths; 10 9 import net.oni2.aeinstaller.backend.AppExecution; 11 10 import net.oni2.aeinstaller.backend.Settings; 12 import net.oni2.aeinstaller.backend.Settings.Architecture;13 11 import net.oni2.aeinstaller.backend.Settings.Platform; 14 import net.oni2.aeinstaller.backend.WinRegistry;15 12 16 13 /** … … 18 15 */ 19 16 public class OniSplit { 20 21 /**22 * @return is a .NET implementation installed?23 */24 public static boolean isDotNETInstalled() {25 switch (Settings.getPlatform()) {26 case WIN:27 try {28 int view = WinRegistry.KEY_WOW64_32KEY;29 if (Settings.getArchitecture() == Architecture.AMD64)30 view = WinRegistry.KEY_WOW64_64KEY;31 32 Map<String, String> m = WinRegistry33 .readStringValues(34 WinRegistry.HKEY_LOCAL_MACHINE,35 "Software\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727",36 view);37 return m != null;38 } catch (IllegalArgumentException e) {39 e.printStackTrace();40 } catch (IllegalAccessException e) {41 e.printStackTrace();42 } catch (InvocationTargetException e) {43 e.printStackTrace();44 } catch (Exception e) {45 if (!e.getMessage()46 .equals("Registry access not supported (not a Windows OS?)."))47 e.printStackTrace();48 }49 return false;50 case MACOS:51 case LINUX:52 Vector<String> cmd = new Vector<String>();53 cmd.add("which");54 cmd.add("mono");55 Vector<String> res = null;56 try {57 res = AppExecution.executeAndWait(cmd);58 } catch (IOException e) {59 e.printStackTrace();60 }61 if (res != null) {62 if (res.get(0).startsWith("/")63 && res.get(0).endsWith("mono")) {64 return true;65 }66 }67 return false;68 default:69 return false;70 }71 }72 17 73 18 /** … … 209 154 private static Vector<String> getProgramInvocation() { 210 155 Vector<String> res = new Vector<String>(); 211 if ( Settings.getPlatform() != Platform.WIN)212 res.add( "mono");156 if (DotNet.getRuntimeExe().length() > 0) 157 res.add(DotNet.getRuntimeExe()); 213 158 res.add(getProgramFile().getPath()); 214 159 return res;
Note:
See TracChangeset
for help on using the changeset viewer.