- Timestamp:
- Mar 31, 2013, 6:02:09 PM (12 years ago)
- Location:
- java
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/gui/MainWin.java
r765 r767 80 80 if (aei.exists()) { 81 81 try { 82 ApplicationInvoker.execute(EExeType.JAR, null, aei, null); 82 ApplicationInvoker 83 .execute(EExeType.JAR, null, aei, null, false); 83 84 } catch (FileNotFoundException e) { 84 85 // TODO Auto-generated catch block -
java/PlatformTools/src/net/oni2/platformtools/PlatformInformation.java
r724 r767 75 75 res = ApplicationInvoker.executeAndWait( 76 76 EExeType.OSBINARY, null, new File("getconf"), 77 params );77 params, false); 78 78 } catch (IOException e) { 79 79 e.printStackTrace(); -
java/PlatformTools/src/net/oni2/platformtools/applicationinvoker/ApplicationInvoker.java
r724 r767 19 19 public class ApplicationInvoker { 20 20 private static Vector<String> buildCommandLine(EExeType exeType, 21 File program, Vector<String> params )21 File program, Vector<String> params, boolean ignoreFileNotFound) 22 22 throws ERuntimeNotInstalledException, FileNotFoundException { 23 if (program.getParentFile() != null && !program.exists()) 24 throw new FileNotFoundException(); 23 if (!ignoreFileNotFound) 24 if (program.getParentFile() != null && !program.exists()) 25 throw new FileNotFoundException(); 25 26 Vector<String> cmdLine = new Vector<String>(); 26 27 switch (exeType) { … … 80 81 * @param params 81 82 * List of command and arguments 83 * @param ignoreFileNotFound 84 * Ignore if the program file is not found 82 85 * @return Error code and list of output lines 83 86 * @throws IOException … … 90 93 */ 91 94 public static ApplicationInvocationResult executeAndWait(EExeType exeType, 92 File workingDirectory, File program, Vector<String> params )93 throws ERuntimeNotInstalledException, FileNotFoundException,94 IOException {95 File workingDirectory, File program, Vector<String> params, 96 boolean ignoreFileNotFound) throws ERuntimeNotInstalledException, 97 FileNotFoundException, IOException { 95 98 return executeAndWait(workingDirectory, 96 buildCommandLine(exeType, program, params ));99 buildCommandLine(exeType, program, params, ignoreFileNotFound)); 97 100 } 98 101 … … 108 111 * @param params 109 112 * List of command and arguments 113 * @param ignoreFileNotFound 114 * Ignore if the program file is not found 110 115 * @throws ERuntimeNotInstalledException 111 116 * If the program to be executed requires a runtime which could … … 115 120 */ 116 121 public static void execute(EExeType exeType, File workingDirectory, 117 File program, Vector<String> params )122 File program, Vector<String> params, boolean ignoreFileNotFound) 118 123 throws ERuntimeNotInstalledException, FileNotFoundException { 119 execute(buildCommandLine(exeType, program, params), workingDirectory); 124 execute(buildCommandLine(exeType, program, params, ignoreFileNotFound), 125 workingDirectory); 120 126 } 121 127 -
java/PlatformTools/src/net/oni2/platformtools/applicationinvoker/DotNet.java
r724 r767 58 58 ApplicationInvocationResult res = null; 59 59 try { 60 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, null, new File("which"), params );60 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, null, new File("which"), params, false); 61 61 } catch (IOException e) { 62 62 e.printStackTrace(); -
java/PlatformTools/src/net/oni2/platformtools/applicationinvoker/Wine.java
r724 r767 36 36 try { 37 37 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, 38 null, new File("which"), params );38 null, new File("which"), params, false); 39 39 } catch (IOException e) { 40 40 e.printStackTrace(); -
java/installer2/src/net/oni2/aeinstaller/AEInstaller2.java
r766 r767 269 269 "AEInstaller2Updater.jar"); 270 270 ApplicationInvoker.execute(EExeType.JAR, null, updater, 271 null );271 null, false); 272 272 return; 273 273 } -
java/installer2/src/net/oni2/aeinstaller/backend/oni/OniLauncher.java
r766 r767 16 16 public class OniLauncher { 17 17 18 private static File getOniExe() {18 private static File getOniExe() throws FileNotFoundException { 19 19 File exe = null; 20 20 switch (PlatformInformation.getPlatform()) { 21 21 case WIN: 22 case LINUX: 22 23 exe = new File(Paths.getEditionBasePath(), "Oni.exe"); 23 break; 24 if (exe.exists()) 25 return exe; 26 else 27 throw new FileNotFoundException( 28 "Oni's executable was not found"); 24 29 case MACOS: 25 30 exe = new File("./Oni.app/Contents/MacOS/Oni"); … … 27 32 "Oni.app/Contents/MacOS/Oni").exists()) 28 33 return exe; 29 break; 30 case LINUX: 31 exe = new File(Paths.getEditionBasePath(), "Oni.exe"); 32 break; 34 else 35 throw new FileNotFoundException( 36 "Oni's executable was not found"); 33 37 default: 34 38 } 35 if ((exe != null) && !exe.exists()) 36 exe = null; 37 return exe; 39 return null; 38 40 } 39 41 … … 58 60 ERuntimeNotInstalledException { 59 61 File exe = getOniExe(); 60 if (exe == null)61 throw new FileNotFoundException("Oni's executable was not found");62 62 Vector<String> params = new Vector<String>(); 63 63 params.add("-debugfiles"); … … 65 65 params.add("-noswitch"); 66 66 ApplicationInvoker.execute(getOniExeType(), Paths.getEditionBasePath(), 67 exe, params );67 exe, params, true); 68 68 } 69 69 -
java/installer2/src/net/oni2/aeinstaller/backend/oni/OniSplit.java
r720 r767 35 35 * @return OniSplit output 36 36 */ 37 public static ApplicationInvocationResult export(File targetFolder, File input) { 37 public static ApplicationInvocationResult export(File targetFolder, 38 File input) { 38 39 return export(targetFolder, input, null); 39 40 } … … 50 51 * @return OniSplit output 51 52 */ 52 public static ApplicationInvocationResult export(File targetFolder, File input,53 Vector<String> patterns) {53 public static ApplicationInvocationResult export(File targetFolder, 54 File input, Vector<String> patterns) { 54 55 if (!targetFolder.exists()) 55 56 targetFolder.mkdir(); … … 66 67 ApplicationInvocationResult res = null; 67 68 try { 68 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, getProgramFile(), params); 69 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 70 getProgramFile(), params, false); 69 71 } catch (IOException e) { 70 72 e.printStackTrace(); … … 84 86 * @return OniSplit output 85 87 */ 86 public static ApplicationInvocationResult importLevel( Vector<File> sourceFolders,87 File targetFile) {88 public static ApplicationInvocationResult importLevel( 89 Vector<File> sourceFolders, File targetFile) { 88 90 Vector<String> params = new Vector<String>(); 89 91 params.add(getImportParam()); … … 93 95 ApplicationInvocationResult res = null; 94 96 try { 95 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, getProgramFile(), params); 97 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 98 getProgramFile(), params, false); 96 99 } catch (IOException e) { 97 100 e.printStackTrace(); … … 113 116 * @return OniSplit output 114 117 */ 115 public static ApplicationInvocationResult packLevel( Vector<File> sourceFoldersFiles,116 File targetFile) {118 public static ApplicationInvocationResult packLevel( 119 Vector<File> sourceFoldersFiles, File targetFile) { 117 120 Vector<String> params = new Vector<String>(); 118 121 params.add(getPackParam()); … … 124 127 ApplicationInvocationResult res = null; 125 128 try { 126 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, getProgramFile(), params); 129 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 130 getProgramFile(), params, false); 127 131 } catch (IOException e) { 128 132 e.printStackTrace(); … … 145 149 * @return OniSplit output 146 150 */ 147 public static ApplicationInvocationResult move(File targetFolder, String input,148 String moveParameter) {151 public static ApplicationInvocationResult move(File targetFolder, 152 String input, String moveParameter) { 149 153 if (!targetFolder.exists()) 150 154 targetFolder.mkdir(); 151 155 152 156 Vector<String> params = new Vector<String>(); 153 params.add("-move" 154 + (moveParameter != null ? ":" + moveParameter : "")); 157 params.add("-move" + (moveParameter != null ? ":" + moveParameter : "")); 155 158 params.add(targetFolder.getPath()); 156 159 params.add(input); 157 160 ApplicationInvocationResult res = null; 158 161 try { 159 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, getProgramFile(), params); 162 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 163 getProgramFile(), params, false); 160 164 } catch (IOException e) { 161 165 e.printStackTrace(); … … 175 179 * @return OniSplit output 176 180 */ 177 public static ApplicationInvocationResult convertOniToXML( File targetFolder,178 Vector<File> inputFiles) {181 public static ApplicationInvocationResult convertOniToXML( 182 File targetFolder, Vector<File> inputFiles) { 179 183 if (!targetFolder.exists()) 180 184 targetFolder.mkdirs(); … … 188 192 ApplicationInvocationResult res = null; 189 193 try { 190 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, getProgramFile(), params); 194 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 195 getProgramFile(), params, false); 191 196 } catch (IOException e) { 192 197 e.printStackTrace(); … … 206 211 * @return OniSplit output 207 212 */ 208 public static ApplicationInvocationResult convertXMLtoOni( File targetFolder,209 Vector<File> inputFiles) {213 public static ApplicationInvocationResult convertXMLtoOni( 214 File targetFolder, Vector<File> inputFiles) { 210 215 if (!targetFolder.exists()) 211 216 targetFolder.mkdirs(); … … 219 224 ApplicationInvocationResult res = null; 220 225 try { 221 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, getProgramFile(), params); 226 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 227 getProgramFile(), params, false); 222 228 } catch (IOException e) { 223 229 e.printStackTrace(); -
java/installer2/src/net/oni2/aeinstaller/backend/oni/XMLTools.java
r744 r767 37 37 try { 38 38 res = ApplicationInvoker.executeAndWait(EExeType.DOTNET, null, 39 getProgramFile(), params );39 getProgramFile(), params, false); 40 40 } catch (IOException e) { 41 41 e.printStackTrace(); -
java/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r749 r767 505 505 try { 506 506 ApplicationInvoker.execute(m.getExeType(), 507 m.getWorkingDir(), m.getExeFile(), null );507 m.getWorkingDir(), m.getExeFile(), null, false); 508 508 } catch (ERuntimeNotInstalledException e) { 509 509 JOptionPane.showMessageDialog(null,
Note:
See TracChangeset
for help on using the changeset viewer.