Initial commit
This commit is contained in:
4
src/main/java/tech/nevets/jamlinstaller/GUI.java
Normal file
4
src/main/java/tech/nevets/jamlinstaller/GUI.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package tech.nevets.jamlinstaller;
|
||||
|
||||
public class GUI {
|
||||
}
|
||||
57
src/main/java/tech/nevets/jamlinstaller/Main.java
Normal file
57
src/main/java/tech/nevets/jamlinstaller/Main.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package tech.nevets.jamlinstaller;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.*;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static Path path = Path.of(System.getenv("APPDATA") + "\\.jaml\\");
|
||||
|
||||
public static void main(String[] args) {
|
||||
makeDirs();
|
||||
try {
|
||||
copyAssets();
|
||||
downloadJar(new URL("https://ci.nevets.tech/view/Minecraft/job/JAML/lastSuccessfulBuild/artifact/target/JAML-latest.jar"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void downloadJar(URL url) throws IOException {
|
||||
FileUtils.copyURLToFile(url, new File(path + "\\jaml.jar"));
|
||||
}
|
||||
|
||||
private static void makeDirs() {
|
||||
try {
|
||||
if (!path.toFile().exists()) {
|
||||
path.toFile().mkdirs();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
Path profilePath = Path.of(path + "\\assets\\");
|
||||
if (!profilePath.toFile().exists()) {
|
||||
profilePath.toFile().mkdirs();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyAssets() throws IOException, URISyntaxException {
|
||||
URL resource = Main.class.getResource("/assets/");
|
||||
File assets = Paths.get(resource.toURI()).toFile();
|
||||
|
||||
FileUtils.copyDirectory(assets, new File(path + "\\assets\\"));
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/icon.png
Normal file
BIN
src/main/resources/assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 210 KiB |
BIN
src/main/resources/assets/jaml.png
Normal file
BIN
src/main/resources/assets/jaml.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
Reference in New Issue
Block a user