@@ -95,6 +95,7 @@ private boolean validate() {
95
95
}
96
96
97
97
public boolean update (String updateChannelId , boolean overwrite ) {
98
+ boolean updated = false ;
98
99
Launcher .getLogger ().log ("[UPDATER] Connecting to update channel " +updateChannelId +"..." );
99
100
try {
100
101
JsonArray versions = new Gson ().fromJson (GsonUtil .getFromURL ("https://raw.githubusercontent.com/zyneonstudios/nexus-nex/main/application/index.json" ), JsonObject .class ).getAsJsonArray ("versions" );
@@ -114,7 +115,8 @@ public boolean update(String updateChannelId, boolean overwrite) {
114
115
app .delete ();
115
116
} else {
116
117
Launcher .getLogger ().log ("[UPDATER] Version " +this .version +" is already installed! Skipping update process..." );
117
- return true ;
118
+ updated = true ;
119
+ break ;
118
120
}
119
121
}
120
122
Launcher .getLogger ().log ("[UPDATER] Downloading..." );
@@ -124,7 +126,8 @@ public boolean update(String updateChannelId, boolean overwrite) {
124
126
this .version = newVersion ;
125
127
config .set ("updater.installed.info.version" , this .version );
126
128
config .set ("updater.installed.info.channel" , this .updateChannel );
127
- return true ;
129
+ updated = true ;
130
+ break ;
128
131
} else {
129
132
Launcher .getLogger ().error ("[UPDATER] Couldn't download new version!" );
130
133
}
@@ -135,7 +138,10 @@ public boolean update(String updateChannelId, boolean overwrite) {
135
138
} catch (Exception e ) {
136
139
throw new RuntimeException (e );
137
140
}
138
- return false ;
141
+ if (!updated ) {
142
+ return update ("stable" ,overwrite );
143
+ }
144
+ return updated ;
139
145
}
140
146
141
147
public int launch (String updateChannelId ) {
0 commit comments