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

Last change on this file since 693 was 672, checked in by alloc, 12 years ago

AEI2 0.99q:

  • Updates dialog: Updating the to-download-size on (un)checking updates to download
  • Updates dialog: Show download size of individual updates
  • Tool execution: Support for .NET tools (Mod_Info.cfg added ExeType flag)
  • Depot backend: Ignore mod nodes with an empty package number field
File size: 1.3 KB
Line 
1package net.oni2.aeinstaller.backend;
2
3import java.io.File;
4import java.util.Vector;
5
6import net.oni2.aeinstaller.backend.Settings.Platform;
7import net.oni2.aeinstaller.backend.packages.Package;
8
9/**
10 * @author Christian Illy
11 */
12public class ToolLauncher {
13 /**
14 * @param p
15 * Package of tool to launch
16 * @throws Exception
17 * If a required runtime is not found
18 */
19 public static void launch(Package p) throws Exception {
20 File exe = p.getExeFile();
21
22 Vector<String> params = new Vector<String>();
23 switch (p.getExeType()) {
24 case OSBINARY:
25 break;
26 case DOTNET:
27 if (!DotNet.isInstalled())
28 throw new Exception(".NET not found");
29 if (Settings.getPlatform() != Platform.WIN) {
30 params.add(DotNet.getRuntimeExe());
31 }
32 break;
33 case JAR:
34 File jre = null;
35 if (Settings.getPlatform() == Platform.WIN)
36 jre = new File(System.getProperties().getProperty(
37 "java.home"), "bin/javaw.exe");
38 else
39 jre = new File(System.getProperties().getProperty(
40 "java.home"), "bin/java");
41 if (!jre.exists())
42 throw new Exception("JRE not found");
43 params.add(jre.getPath());
44 params.add("-jar");
45 break;
46 }
47 params.add(exe.getPath());
48
49 File wd = p.getWorkingDir();
50
51 AppExecution.execute(params, wd);
52 }
53}
Note: See TracBrowser for help on using the repository browser.