Changeset 924
- Timestamp:
- Feb 4, 2014, 8:36:53 PM (11 years ago)
- Location:
- java/installer2/src/net/oni2/aeinstaller
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r886 r924 1 1 appname=AE Installer 2 2 appversion=.1 62 appversion=.17 -
java/installer2/src/net/oni2/aeinstaller/backend/oni/XMLTools.java
r767 r924 7 7 import net.oni2.aeinstaller.backend.CaseInsensitiveFile; 8 8 import net.oni2.aeinstaller.backend.Paths; 9 import net.oni2.platformtools.PlatformInformation; 9 10 import net.oni2.platformtools.applicationinvoker.ApplicationInvoker; 10 11 import net.oni2.platformtools.applicationinvoker.ApplicationInvocationResult; … … 18 19 19 20 /** 20 * Patch the given XML file with the given patch21 * Patch the XML files in the path with the patches in the other path 21 22 * 22 * @param patch23 * Pat chfile24 * @param source25 * Fileto patch23 * @param folderWithPatches 24 * Path containing patches to apply 25 * @param folderWithXml 26 * Path containing XML files to patch 26 27 * 27 28 * @return XMLTools output 28 29 */ 29 public static ApplicationInvocationResult patch(File patch, File source) { 30 public static ApplicationInvocationResult patch(File folderWithPatches, 31 File folderWithXml) { 30 32 Vector<String> params = new Vector<String>(); 31 // xmlTools.exe patchfile -filename:PATCH -forceinfiles:TOPATCH 32 params.add("patchfile"); 33 params.add("-filename:" + patch.getPath()); 34 if (source != null) 35 params.add("-forceinfiles:" + source.getPath()); 33 // xmlTools.exe --patch-files PATCH --force-target-files TOPATCH 34 params.add("--patch-files " 35 + new File(folderWithPatches, "*.oni-patch").getPath()); 36 params.add("--use-patch-filename " + folderWithXml.getPath()); 36 37 ApplicationInvocationResult res = null; 37 38 try { 38 res = ApplicationInvoker.executeAndWait(EExeType. DOTNET, null,39 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, null, 39 40 getProgramFile(), params, false); 40 41 } catch (IOException e) { … … 49 50 File toolsPath = CaseInsensitiveFile.getCaseInsensitiveFile( 50 51 Paths.getEditionBasePath(), "Tools"); 51 return CaseInsensitiveFile.getCaseInsensitiveFile(toolsPath, 52 "xmlTools.exe"); 52 File xmlToolsPath = CaseInsensitiveFile.getCaseInsensitiveFile( 53 toolsPath, "XmlTools"); 54 switch (PlatformInformation.getPlatform()) { 55 case WIN: 56 return CaseInsensitiveFile.getCaseInsensitiveFile(xmlToolsPath, 57 "XmlTools.exe"); 58 case LINUX: 59 case MACOS: 60 return CaseInsensitiveFile.getCaseInsensitiveFile(xmlToolsPath, 61 "XmlTools"); 62 default: 63 } 64 return null; 53 65 } 54 66 } -
java/installer2/src/net/oni2/aeinstaller/backend/oni/management/Installer.java
r810 r924 7 7 import java.io.IOException; 8 8 import java.io.InputStream; 9 import java.io.PrintWriter;10 9 import java.text.SimpleDateFormat; 11 10 import java.util.Date; … … 480 479 log.logAppOutput(res, true); 481 480 482 // Create masterpatch file (containing calls to all individual 483 // patches) 484 File masterpatch = new File(levelFolderXML, "masterpatch.oni-patch"); 485 PrintWriter masterpatchWriter = null; 486 try { 487 masterpatchWriter = new PrintWriter(masterpatch); 488 } catch (FileNotFoundException e) { 489 e.printStackTrace(); 490 } 491 for (File patch : patches.get(level)) { 492 String patternWildcard = patch.getName(); 493 patternWildcard = patternWildcard.substring(0, 494 patternWildcard.indexOf(".oni-patch")); 495 patternWildcard = patternWildcard + ".xml"; 496 patternWildcard = patternWildcard.replace('-', '*'); 497 File xmlFilePath = new File(levelFolderXML, patternWildcard); 498 masterpatchWriter 499 .println(String 500 .format("@COMMAND patchfile -filename:\"%s\" -forceinfiles:\"%s\"", 501 patch.getPath(), xmlFilePath.getPath())); 502 } 503 masterpatchWriter.close(); 504 // Apply patches through masterpatch in levelFolderXML 505 res = XMLTools.patch(masterpatch, null); 506 log.logAppOutput(res, false); 481 // Apply patches in levelFolderXML 482 File lastFolder = null; 483 for (File f : patches.get(level)) { 484 File pathOfPatch = f.getParentFile(); 485 if (!pathOfPatch.equals(lastFolder)) { 486 lastFolder = pathOfPatch; 487 488 res = XMLTools.patch(pathOfPatch, levelFolderXML); 489 log.logAppOutput(res, false); 490 } 491 } 507 492 508 493 // Create .oni files from XML -
java/installer2/src/net/oni2/aeinstaller/gui/downloadwindow/Downloader.java
r840 r924 64 64 65 65 setResizable(false); 66 setSize( 500, (int) getSize().getHeight());66 setSize(600, (int) getSize().getHeight()); 67 67 68 68 if (dependencies != null)
Note:
See TracChangeset
for help on using the changeset viewer.