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

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

AEI2 0.99t:

  • Access to files/folders which can be different in case because of user interaction are now case insensitive
  • Few cleanups
File size: 1.5 KB
RevLine 
[698]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.AppExecution;
[699]8import net.oni2.aeinstaller.backend.CaseInsensitiveFile;
[698]9import net.oni2.aeinstaller.backend.DotNet;
10import net.oni2.aeinstaller.backend.Paths;
11
12/**
13 * @author Christian Illy
14 */
15public class XMLTools {
16
17 /**
18 * Patch the given XML file with the given patch
19 *
20 * @param patch
21 * Patchfile
22 * @param source
23 * File to patch
24 *
25 * @return XMLTools output
26 */
27 public static Vector<String> patch(File patch, File source) {
28 Vector<String> cmdLine = getProgramInvocation();
29 // xmlTools.exe patchfile -filename:PATCH -forceinfiles:TOPATCH
30 cmdLine.add("patchfile");
31 cmdLine.add("-filename:" + patch.getPath());
32 cmdLine.add("-forceinfiles:" + source.getPath());
33 Vector<String> res = null;
34 try {
35 res = AppExecution.executeAndWait(cmdLine);
36 } catch (IOException e) {
37 e.printStackTrace();
38 }
39 return res;
40 }
41
42 private static Vector<String> getProgramInvocation() {
43 Vector<String> res = new Vector<String>();
44 if (DotNet.getRuntimeExe().length() > 0)
45 res.add(DotNet.getRuntimeExe());
46 res.add(getProgramFile().getPath());
47 return res;
48 }
49
50 private static File getProgramFile() {
[699]51 File toolsPath = CaseInsensitiveFile.getCaseInsensitiveFile(Paths.getEditionBasePath(), "Tools");
52 return CaseInsensitiveFile.getCaseInsensitiveFile(toolsPath, "xmlTools.exe");
[698]53 }
54}
Note: See TracBrowser for help on using the repository browser.