fix: All folders are created correctly at startup if missing

To create a clean empty instance of the manager just copy the folders "jre" and "vice" and PCUAEManager.exe to a new folder.
This commit is contained in:
lantzelot-swe 2023-10-19 22:57:19 +02:00
parent 23e325475a
commit 64c919cabc
1 changed files with 15 additions and 17 deletions

View File

@ -46,20 +46,6 @@ public class PCUAEManager
ExceptionHandler.handleException(e, "Startup failure");
}
SwingUtilities.invokeLater(() -> {
MainWindow mainWindow = MainWindow.getInstance();
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int width = gd.getDisplayMode().getWidth();
int height = gd.getDisplayMode().getHeight();
mainWindow.setSize(Math.min(width, 1500), Math.min(height - 40, 825));
mainWindow.setMinimumSize(new Dimension(Math.min(width, 1300), Math.min(height - 40, 700)));
mainWindow.setLocationRelativeTo(null);
mainWindow.initialize();
mainWindow.setVisible(true);
//Make sure all folders are available
try
{
@ -75,7 +61,19 @@ public class PCUAEManager
e.printStackTrace();
}
SwingUtilities.invokeLater(() -> {
MainWindow mainWindow = MainWindow.getInstance();
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int width = gd.getDisplayMode().getWidth();
int height = gd.getDisplayMode().getHeight();
mainWindow.setSize(Math.min(width, 1500), Math.min(height - 40, 825));
mainWindow.setMinimumSize(new Dimension(Math.min(width, 1300), Math.min(height - 40, 700)));
mainWindow.setLocationRelativeTo(null);
mainWindow.initialize();
mainWindow.setVisible(true);
//Check for new versions at startup, but only when running stand-alone, not during development.
if (!FileManager.getPcuVersionFromManifest().isEmpty())