-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.java
More file actions
68 lines (55 loc) · 2.18 KB
/
installer.java
File metadata and controls
68 lines (55 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.util.Scanner;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class installer {
public static void main(String[] args) {
// Create a new instance of the installer
System.out.println("welcome to the BitCore installer");
System.out.println("Please select an option:");
System.out.println("1. Install BitCore");
System.out.println("2. Uninstall BitCore");
System.out.println("3. Update BitCore");
System.out.println("4. Exit");
@SuppressWarnings("resource")
Scanner scanner = new Scanner(System.in);
int choice = scanner.nextInt();
switch (choice) {
case 1 -> {
System.out.println("Installing BitCore...");
System.out.println("Please wait...");
SimulateLoading();
System.out.println("Installation complete!");
break;
}
case 2 -> {
System.out.println("Uninstalling BitCore...");
System.out.println("Please wait...");
SimulateLoading();
break;
}
case 3 -> {
System.out.println("Updating BitCore...");
System.out.println("Please wait...");
SimulateLoading();
break;
}
case 4 -> {
System.out.println("Exiting...");
System.exit(0);
break;
}
}
}
private static void SimulateLoading() {
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
@SuppressWarnings("unused")
Runnable loadingTask = () -> System.out.println("Loading...");
executor.scheduleAtFixedRate(loadingTask, 0, 1, TimeUnit.SECONDS);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
executor.shutdown();
}
}