ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/installer2/src/net/oni2/aeinstaller/backend/ToolLauncher.java
Revision: 702
Committed: Tue Mar 19 10:00:06 2013 UTC (12 years, 6 months ago) by alloc
Content type: text/x-java
File size: 1364 byte(s)
Log Message:
AEI2 0.99u:
- Fixed a few bugs in apply patches
- Added some log output to apply patches

File Contents

# Content
1 package net.oni2.aeinstaller.backend;
2
3 import java.io.File;
4 import java.util.Vector;
5
6 import net.oni2.aeinstaller.backend.Settings.Platform;
7 import net.oni2.aeinstaller.backend.appexecution.AppExecution;
8 import net.oni2.aeinstaller.backend.packages.Package;
9
10 /**
11 * @author Christian Illy
12 */
13 public 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 }