ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/installer2/src/net/oni2/aeinstaller/backend/oni/XMLTools.java
Revision: 698
Committed: Wed Mar 13 19:00:39 2013 UTC (12 years, 7 months ago) by alloc
Content type: text/x-java
File size: 1335 byte(s)
Log Message:
AEI2 0.99s:
- Fix for update window file size display
- Fix for download speed/time estimation
- Added patches-support

File Contents

# Content
1 package net.oni2.aeinstaller.backend.oni;
2
3 import java.io.File;
4 import java.io.IOException;
5 import java.util.Vector;
6
7 import net.oni2.aeinstaller.backend.AppExecution;
8 import net.oni2.aeinstaller.backend.DotNet;
9 import net.oni2.aeinstaller.backend.Paths;
10
11 /**
12 * @author Christian Illy
13 */
14 public class XMLTools {
15
16 /**
17 * Patch the given XML file with the given patch
18 *
19 * @param patch
20 * Patchfile
21 * @param source
22 * File to patch
23 *
24 * @return XMLTools output
25 */
26 public static Vector<String> patch(File patch, File source) {
27 Vector<String> cmdLine = getProgramInvocation();
28 // xmlTools.exe patchfile -filename:PATCH -forceinfiles:TOPATCH
29 cmdLine.add("patchfile");
30 cmdLine.add("-filename:" + patch.getPath());
31 cmdLine.add("-forceinfiles:" + source.getPath());
32 Vector<String> res = null;
33 try {
34 res = AppExecution.executeAndWait(cmdLine);
35 } catch (IOException e) {
36 e.printStackTrace();
37 }
38 return res;
39 }
40
41 private static Vector<String> getProgramInvocation() {
42 Vector<String> res = new Vector<String>();
43 if (DotNet.getRuntimeExe().length() > 0)
44 res.add(DotNet.getRuntimeExe());
45 res.add(getProgramFile().getPath());
46 return res;
47 }
48
49 private static File getProgramFile() {
50 return new File(new File(Paths.getEditionBasePath(), "Tools"),
51 "xmlTools.exe");
52 }
53 }