source: AE/installer2/src/net/oni2/aeinstaller/backend/ToolLauncher.java@ 703

Last change on this file since 703 was 702, checked in by alloc, 12 years ago

AEI2 0.99u:

  • Fixed a few bugs in apply patches
  • Added some log output to apply patches
File size: 1.3 KB
RevLine 
[672]1package net.oni2.aeinstaller.backend;
2
3import java.io.File;
4import java.util.Vector;
5
6import net.oni2.aeinstaller.backend.Settings.Platform;
[702]7import net.oni2.aeinstaller.backend.appexecution.AppExecution;
[672]8import net.oni2.aeinstaller.backend.packages.Package;
9
10/**
11 * @author Christian Illy
12 */
13public class ToolLauncher {
14 /**
15 * @param p
16 * Package of tool to launch
17 * @throws Exception
18 * If a required runtime is not found
19 */
20 public static void launch(Package p) throws Exception {
21 File exe = p.getExeFile();
22
23 Vector<String> params = new Vector<String>();
24 switch (p.getExeType()) {
25 case OSBINARY:
26 break;
27 case DOTNET:
28 if (!DotNet.isInstalled())
29 throw new Exception(".NET not found");
30 if (Settings.getPlatform() != Platform.WIN) {
31 params.add(DotNet.getRuntimeExe());
32 }
33 break;
34 case JAR:
35 File jre = null;
36 if (Settings.getPlatform() == Platform.WIN)
37 jre = new File(System.getProperties().getProperty(
38 "java.home"), "bin/javaw.exe");
39 else
40 jre = new File(System.getProperties().getProperty(
41 "java.home"), "bin/java");
42 if (!jre.exists())
43 throw new Exception("JRE not found");
44 params.add(jre.getPath());
45 params.add("-jar");
46 break;
47 }
48 params.add(exe.getPath());
49
50 File wd = p.getWorkingDir();
51
52 AppExecution.execute(params, wd);
53 }
54}
Note: See TracBrowser for help on using the repository browser.