| 16 |
|
import javax.swing.UIManager; |
| 17 |
|
import javax.swing.UIManager.LookAndFeelInfo; |
| 18 |
|
|
| 19 |
< |
import net.oni2.aeinstaller.backend.OniSplit; |
| 19 |
> |
import net.oni2.aeinstaller.backend.Paths; |
| 20 |
|
import net.oni2.aeinstaller.backend.Settings; |
| 21 |
|
import net.oni2.aeinstaller.backend.Settings.Platform; |
| 22 |
|
import net.oni2.aeinstaller.backend.StuffToRefactorLater; |
| 23 |
|
import net.oni2.aeinstaller.backend.depot.DepotManager; |
| 24 |
+ |
import net.oni2.aeinstaller.backend.oni.Installer; |
| 25 |
+ |
import net.oni2.aeinstaller.backend.oni.OniSplit; |
| 26 |
|
import net.oni2.aeinstaller.gui.MainWin; |
| 27 |
|
|
| 28 |
|
import org.javabuilders.swing.SwingJavaBuilder; |
| 63 |
|
* Command line arguments |
| 64 |
|
*/ |
| 65 |
|
public static void main(String[] args) { |
| 66 |
< |
new File(Settings.getPrefsPath()).mkdirs(); |
| 67 |
< |
new File(Settings.getDownloadPath()).mkdirs(); |
| 66 |
> |
Paths.getPrefsPath().mkdirs(); |
| 67 |
> |
Paths.getDownloadPath().mkdirs(); |
| 68 |
|
|
| 69 |
|
boolean debug = false; |
| 70 |
|
for (String a : args) |
| 72 |
|
debug = true; |
| 73 |
|
if (!debug) { |
| 74 |
|
try { |
| 75 |
< |
System.setOut(new PrintStream(Settings.getPrefsPath() |
| 76 |
< |
+ "aei_output.log")); |
| 77 |
< |
System.setErr(new PrintStream(Settings.getPrefsPath() |
| 78 |
< |
+ "aei_error.log")); |
| 75 |
> |
System.setOut(new PrintStream(new File(Paths.getPrefsPath(), |
| 76 |
> |
"aei_output.log"))); |
| 77 |
> |
System.setErr(new PrintStream(new File(Paths.getPrefsPath(), |
| 78 |
> |
"aei_error.log"))); |
| 79 |
|
} catch (FileNotFoundException e1) { |
| 80 |
|
e1.printStackTrace(); |
| 81 |
|
} |
| 87 |
|
Settings.deserializeFromFile(); |
| 88 |
|
Settings.setDebug(debug); |
| 89 |
|
DepotManager.getInstance().loadFromFile( |
| 90 |
< |
new File(Settings.getDepotCacheFilename())); |
| 90 |
> |
Settings.getDepotCacheFilename()); |
| 91 |
|
|
| 92 |
|
SwingJavaBuilder.getConfig().addResourceBundle(imagesBundle); |
| 93 |
|
SwingJavaBuilder.getConfig().addResourceBundle(basicBundle); |
| 97 |
|
|
| 98 |
|
System.setProperty("networkaddress.cache.ttl", "5"); |
| 99 |
|
System.setProperty("networkaddress.cache.negative.ttl", "1"); |
| 100 |
< |
|
| 100 |
> |
|
| 101 |
|
try { |
| 102 |
|
String laf = Settings.getInstance().get("lookandfeel", |
| 103 |
|
(String) null); |
| 121 |
|
JFrame.setDefaultLookAndFeelDecorated(true); |
| 122 |
|
|
| 123 |
|
// TODO |
| 124 |
< |
System.out.println("JarPath: " + Settings.getJarPath()); |
| 125 |
< |
System.out.println("PrefsPath: " + Settings.getPrefsPath()); |
| 126 |
< |
System.out.println("DataPath: " + Settings.getDataPath()); |
| 127 |
< |
System.out.println("DownPath: " + Settings.getDownloadPath()); |
| 128 |
< |
System.out.println("TempPath: " + Settings.getTempPath()); |
| 124 |
> |
System.out.println("JarPath: " + Paths.getInstallerPath()); |
| 125 |
> |
System.out.println("PrefsPath: " + Paths.getPrefsPath()); |
| 126 |
> |
System.out.println("DataPath: " + Paths.getModsPath()); |
| 127 |
> |
System.out.println("DownPath: " + Paths.getDownloadPath()); |
| 128 |
> |
System.out.println("TempPath: " + Paths.getTempPath()); |
| 129 |
|
System.out.println("ValidPath: " |
| 130 |
|
+ StuffToRefactorLater.verifyRunningDirectory()); |
| 131 |
|
System.out.println("Platform: " + Settings.getPlatform()); |
| 132 |
|
System.out.println("Architect: " + Settings.getArchitecture()); |
| 133 |
|
System.out.println(".NET: " + OniSplit.isDotNETInstalled()); |
| 134 |
+ |
System.out.println("Globalized:" + Installer.isEditionInitialized()); |
| 135 |
|
|
| 136 |
|
if (!StuffToRefactorLater.verifyRunningDirectory()) { |
| 137 |
|
JOptionPane.showMessageDialog(null, |
| 141 |
|
if (!Settings.getDebug()) { |
| 142 |
|
return; |
| 143 |
|
} |
| 144 |
+ |
} else { |
| 145 |
+ |
Installer.initializeEdition(); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
SwingUtilities.invokeLater(new Runnable() { |