mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
App_update: Do not show Special:XowaAppUpdate if brand-new install
This commit is contained in:
parent
200356d8ff
commit
0cc664121a
@ -27,8 +27,10 @@ public class Xoa_update_startup {
|
||||
|
||||
// check online for updates
|
||||
Io_url db_url = Xoa_update_db_mgr_.Url(app);
|
||||
if (Xoa_update_db_mgr_.Download_from_inet(app, Bool_.Y, db_url))
|
||||
return true;
|
||||
boolean offline_exists = Io_mgr.Instance.ExistsFil(db_url);
|
||||
if (Xoa_update_db_mgr_.Download_from_inet(app, Bool_.Y, db_url)) {
|
||||
return offline_exists; // if !offline_exists, then application is brand-new install; don't bother showing update
|
||||
}
|
||||
|
||||
// check offline for updates
|
||||
DateAdp ignore_date = cfg.Get_date_app_or(Cfg__ignore_date, DateAdp_.parse_fmt(Xoa_app_.Build_date, Xoa_app_.Build_date_fmt));
|
||||
|
@ -39,7 +39,7 @@ public class Xoa_update_db_mgr_ {
|
||||
// check text file to see if version changed
|
||||
Io_url trg_summary_fil = db_url.OwnerDir().GenSubFil("xoa_update.txt");
|
||||
int trg_summary_version = Bry_.To_int_or(Io_mgr.Instance.LoadFilBryOr(trg_summary_fil, Bry_.new_a7("-1")), -1);
|
||||
String src_summary_server = app.Cfg().Get_str_app_or("xowa.app.inet.server_url", "http://xowa.org"); // CFG:Cfg__
|
||||
String src_summary_server = app.Cfg().Get_str_app_or("xowa.app.update.inet.server_url", "http://xowa.org"); // CFG:Cfg__
|
||||
byte[] src_summary_bry = Io_mgr.Instance.DownloadFil_args("", Io_url_.Empty).Exec_as_bry(src_summary_server + "/admin/app_update/xoa_update.txt");
|
||||
if (src_summary_bry == null) return false;
|
||||
int src_summary_version = Bry_.To_int(src_summary_bry);
|
||||
|
@ -88,8 +88,11 @@ class Xoa_update_svc implements Gfo_invk {
|
||||
Io_url manifest_url = update_dir.GenSubFil("xoa_update_manifest.txt");
|
||||
Io_mgr.Instance.SaveFilBfr(manifest_url, bfr);
|
||||
|
||||
// update prog as finished
|
||||
replace_wkr.Cbk_mgr().Send_json(replace_wkr.Cbk_trg(), "xo.app_updater.download__prog", Gfobj_nde.New().Add_bool("done", true));
|
||||
Xoa_update_startup.Set_ignore_date_to_now(app); // update ignore_date so current offline updates are ignore
|
||||
|
||||
// run standalone app
|
||||
Runtime_.Exec("java -jar " + update_jar_fil.Raw()+ " " + manifest_url.Raw());
|
||||
System_.Exit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user