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

Last change on this file since 752 was 744, checked in by alloc, 12 years ago

AEI2 0.99w:

  • Bottom part of main win made a bit tighter (less wasted space below/above)
  • Use natural order for levels on initialization/installation (0, 1, 2, ..., 10 ... instead of 0, 1, 10, ...)
  • Adapter patching to xmlTools >0.8b so it only spawns one instance of xmlTools per level
File size: 1.6 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;
[720]9import net.oni2.platformtools.applicationinvoker.ApplicationInvoker;
10import net.oni2.platformtools.applicationinvoker.ApplicationInvocationResult;
11import net.oni2.platformtools.applicationinvoker.EExeType;
12import net.oni2.platformtools.applicationinvoker.ERuntimeNotInstalledException;
[698]13
14/**
15 * @author Christian Illy
16 */
17public class XMLTools {
18
19 /**
20 * Patch the given XML file with the given patch
21 *
22 * @param patch
23 * Patchfile
24 * @param source
25 * File to patch
26 *
27 * @return XMLTools output
28 */
[720]29 public static ApplicationInvocationResult patch(File patch, File source) {
30 Vector<String> params = new Vector<String>();
[698]31 // xmlTools.exe patchfile -filename:PATCH -forceinfiles:TOPATCH
[720]32 params.add("patchfile");
33 params.add("-filename:" + patch.getPath());
[744]34 if (source != null)
35 params.add("-forceinfiles:" + source.getPath());
[720]36 ApplicationInvocationResult res = null;
[698]37 try {
[720]38 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null,
39 getProgramFile(), params);
[698]40 } catch (IOException e) {
41 e.printStackTrace();
[720]42 } catch (ERuntimeNotInstalledException e) {
43 e.printStackTrace();
[698]44 }
45 return res;
46 }
47
48 private static File getProgramFile() {
[720]49 File toolsPath = CaseInsensitiveFile.getCaseInsensitiveFile(
50 Paths.getEditionBasePath(), "Tools");
51 return CaseInsensitiveFile.getCaseInsensitiveFile(toolsPath,
52 "xmlTools.exe");
[698]53 }
54}
Note: See TracBrowser for help on using the repository browser.