source: java/installer2/src/net/oni2/aeinstaller/backend/oni/XMLTools.java@ 1088

Last change on this file since 1088 was 937, checked in by alloc, 11 years ago

Change to 2.17:

  • Updated XmlTools invocation again (path passed as separate param)
File size: 1.7 KB
Line 
1package net.oni2.aeinstaller.backend.oni;
2
3import java.io.File;
4import java.io.IOException;
5import java.util.Vector;
6
7import net.oni2.aeinstaller.backend.CaseInsensitiveFile;
8import net.oni2.aeinstaller.backend.Paths;
9import net.oni2.platformtools.PlatformInformation;
10import net.oni2.platformtools.applicationinvoker.ApplicationInvoker;
11import net.oni2.platformtools.applicationinvoker.ApplicationInvocationResult;
12import net.oni2.platformtools.applicationinvoker.EExeType;
13import net.oni2.platformtools.applicationinvoker.ERuntimeNotInstalledException;
14
15/**
16 * @author Christian Illy
17 */
18public class XMLTools {
19
20 /**
21 * Patch XML files with the given patch list
22 *
23 * @param patch
24 * Patchlist file
25 *
26 * @return XMLTools output
27 */
28 public static ApplicationInvocationResult patch(File patch) {
29 Vector<String> params = new Vector<String>();
30 params.add("--aei-patch-files-list");
31 params.add(patch.getPath());
32 ApplicationInvocationResult res = null;
33 try {
34 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, null,
35 getProgramFile(), params, false);
36 } catch (IOException e) {
37 e.printStackTrace();
38 } catch (ERuntimeNotInstalledException e) {
39 e.printStackTrace();
40 }
41 return res;
42 }
43
44 private static File getProgramFile() {
45 File toolsPath = CaseInsensitiveFile.getCaseInsensitiveFile(
46 Paths.getEditionBasePath(), "Tools");
47 File xmlToolsPath = CaseInsensitiveFile.getCaseInsensitiveFile(
48 toolsPath, "XmlTools");
49 switch (PlatformInformation.getPlatform()) {
50 case WIN:
51 return CaseInsensitiveFile.getCaseInsensitiveFile(xmlToolsPath,
52 "XmlTools.exe");
53 case LINUX:
54 case MACOS:
55 return CaseInsensitiveFile.getCaseInsensitiveFile(xmlToolsPath,
56 "XmlTools");
57 default:
58 }
59 return null;
60 }
61}
Note: See TracBrowser for help on using the repository browser.