Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Update to beta 1
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed May 24, 2024
1 parent d48ef95 commit efa9118
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>application-main</artifactId>
<version>2024.5-alpha.12</version>
<version>2024.5-beta.1</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public void resolveRequest(String request) {

private void init(String request) {
frame.executeJavaScript("syncDesktop(); setColors('"+ApplicationConfig.theme+"');");
if(request.equals("start")) {
frame.executeJavaScript("activateMenu('menu',true);");
} else {
frame.executeJavaScript("deactivateMenu('menu',true);");
}
}

// Method to synchronize settings and updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ public class NexusApplication {

private final JFrame frame;
private static final Logger logger = new Logger("APP");
private ModuleLoader moduleLoader = new ModuleLoader(this);
private static ModuleLoader moduleLoader = null;

public NexusApplication() {
// Initializing the application frame
moduleLoader = new ModuleLoader(this);
logger.log("[APP] Updated application ui: "+update());
try {
FlatDarkLaf.setup();
Expand Down Expand Up @@ -86,12 +87,31 @@ public JFrame getFrame() {
private static boolean update() {
boolean updated;
try {
if(!new File(getApplicationPath() + "modules/").exists()) {
logger.debug("[APP] Created modules path: "+new File(getApplicationPath() + "modules/").mkdirs());
if(!new File(getApplicationPath() + "temp/modules/").exists()) {
logger.debug("[APP] Created modules path: "+new File(getApplicationPath() + "temp/modules/").mkdirs());
}
FileUtil.extractResourceFile("modules.zip",getApplicationPath()+"temp/modules.zip",Main.class);
FileUtil.unzipFile(getApplicationPath()+"temp/modules.zip", getApplicationPath() + "modules/");
FileUtil.extractResourceFile("modules.zip",getApplicationPath()+"temp/modules.zip",NexusApplication.class);
FileUtil.unzipFile(getApplicationPath()+"temp/modules.zip", getApplicationPath() + "temp/modules/");
logger.debug("[APP] Deleted modules archive: "+new File(getApplicationPath()+"temp/modules.zip").delete());
File modules = new File(getApplicationPath() + "temp/modules/");
if(modules.exists()) {
System.out.println(1);
if(modules.isDirectory()) {
System.out.println(2);
for(File module : modules.listFiles()) {
System.out.println(3);
if(module.getName().toLowerCase().endsWith(".jar")) {
System.out.println(4);
try {
System.out.println(5);
moduleLoader.loadModule(moduleLoader.readModule(module));
} catch (Exception e) {
getLogger().error("Couldn't load module "+module.getName()+": "+e.getMessage());
}
}
}
}
}
} catch (Exception e) {
logger.error("[APP] Couldn't extract modules: "+e.getMessage());
}
Expand Down
Binary file modified application-main/src/main/resources/modules.zip
Binary file not shown.

0 comments on commit efa9118

Please sign in to comment.