| 4 |
|
import java.io.File; |
| 5 |
|
import java.io.FileNotFoundException; |
| 6 |
|
import java.io.IOException; |
| 7 |
– |
import java.io.PrintStream; |
| 7 |
|
import java.lang.reflect.InvocationTargetException; |
| 8 |
|
import java.lang.reflect.Method; |
| 9 |
|
import java.net.MalformedURLException; |
| 10 |
|
import java.net.URL; |
| 11 |
|
import java.net.URLClassLoader; |
| 12 |
+ |
import java.text.SimpleDateFormat; |
| 13 |
+ |
import java.util.Date; |
| 14 |
|
import java.util.ResourceBundle; |
| 15 |
|
|
| 16 |
|
import javax.imageio.ImageIO; |
| 24 |
|
import net.oni2.ProxySettings; |
| 25 |
|
import net.oni2.SettingsManager; |
| 26 |
|
import net.oni2.aeinstaller.backend.CaseInsensitiveFile; |
| 27 |
+ |
import net.oni2.aeinstaller.backend.LogPrintStream; |
| 28 |
|
import net.oni2.aeinstaller.backend.Paths; |
| 29 |
|
import net.oni2.aeinstaller.backend.RuntimeOptions; |
| 30 |
|
import net.oni2.aeinstaller.backend.SizeFormatter; |
| 128 |
|
if (a.equalsIgnoreCase("-usewd")) |
| 129 |
|
RuntimeOptions.setUseWorkingDir(true); |
| 130 |
|
} |
| 131 |
+ |
LogPrintStream lps = LogPrintStream.getInstance(); |
| 132 |
|
if (!RuntimeOptions.isDebug()) { |
| 133 |
|
try { |
| 134 |
< |
PrintStream ps = new PrintStream(new File(Paths.getPrefsPath(), |
| 132 |
< |
"aei_output.log")); |
| 133 |
< |
System.setOut(ps); |
| 134 |
< |
System.setErr(ps); |
| 134 |
> |
lps.setFile(new File(Paths.getPrefsPath(), "aei_output.log")); |
| 135 |
|
} catch (FileNotFoundException e1) { |
| 136 |
|
e1.printStackTrace(); |
| 137 |
+ |
} catch (IOException e) { |
| 138 |
+ |
e.printStackTrace(); |
| 139 |
|
} |
| 140 |
|
} |
| 141 |
|
|
| 143 |
|
initMacOS(); |
| 144 |
|
|
| 145 |
|
SettingsManager.deserializeFromFile(Paths.getSettingsFilename()); |
| 146 |
< |
|
| 146 |
> |
|
| 147 |
|
if (Paths.getProxySettingsFilename().exists()) { |
| 148 |
|
ProxySettings.deserializeFromFile(Paths.getProxySettingsFilename()); |
| 149 |
|
} |
| 150 |
< |
|
| 150 |
> |
|
| 151 |
|
initBundles(); |
| 152 |
|
|
| 153 |
|
SwingJavaBuilder.getConfig().addResourceBundle(imagesBundle); |
| 182 |
|
} |
| 183 |
|
JFrame.setDefaultLookAndFeelDecorated(true); |
| 184 |
|
|
| 185 |
+ |
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 186 |
|
System.out.println(basicBundle.getString("appname") |
| 187 |
|
+ basicBundle.getString("appversion")); |
| 188 |
+ |
System.out.println("Time: " + sdf.format(new Date())); |
| 189 |
+ |
System.out.println("Java: \"" |
| 190 |
+ |
+ System.getProperty("java.runtime.name") + "\" v. " |
| 191 |
+ |
+ System.getProperty("java.version") + " by \"" |
| 192 |
+ |
+ System.getProperty("java.vendor") + "\" (spec. " |
| 193 |
+ |
+ System.getProperty("java.specification.version") + ")"); |
| 194 |
+ |
System.out.println("Java home: " + System.getProperty("java.home")); |
| 195 |
+ |
System.out.println("Command: " |
| 196 |
+ |
+ System.getProperty("sun.java.command")); |
| 197 |
|
System.out.println("JarPath: " + Paths.getJarPath()); |
| 198 |
|
System.out.println("PrefsPath: " + Paths.getPrefsPath()); |
| 199 |
|
System.out.println("DataPath: " + Paths.getModsPath()); |