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

Last change on this file since 927 was 925, checked in by alloc, 11 years ago

Change to 2.17:

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