fix the router.config file for the user if they installed un-bundled after bundled

This commit is contained in:
idk
2022-09-19 23:50:46 -04:00
parent f4f7935cdc
commit c4bd64a559

View File

@@ -158,29 +158,39 @@ public class WinLauncher extends CopyConfigDir {
// wrong update URL. Check for it, and change it back if necessary. // wrong update URL. Check for it, and change it back if necessary.
i2pRouter = new Router(routerConfig(), System.getProperties()); i2pRouter = new Router(routerConfig(), System.getProperties());
if (isInstalled("i2p") || checkProgramFilesInstall()) { if (isInstalled("i2p") || checkProgramFilesInstall()) {
if (i2pRouter.getConfig("router.newsURL").contains("win/beta")) { String newsURL = i2pRouter.getConfig("router.newsURL");
logger.info( if (newsURL != null) {
"checked router.newsURL config, containes win/beta in a service install, invalid update type"); if (newsURL.contains("win/beta")) {
if (i2pRouter.saveConfig("router.newsURL", ServiceUpdaterString())) { logger.info(
logger.info("updated routerconsole.browser config " + appImageExe()); "checked router.newsURL config, containes win/beta in a service install, invalid update type");
if (i2pRouter.saveConfig("router.newsURL", ServiceUpdaterString())) {
logger.info("updated routerconsole.browser config " +
appImageExe());
}
} }
} }
if (i2pRouter.getConfig("router.backupNewsURL").contains("win/beta")) { String backupNewsURL = i2pRouter.getConfig("router.backupNewsURL");
logger.info( if (backupNewsURL != null) {
"checked router.backupNewsURL config, containes win/beta in a service install, invalid update type"); if (backupNewsURL.contains("win/beta")) {
if (i2pRouter.saveConfig("router.backupNewsURL", logger.info(
ServiceUpdaterString())) { "checked router.backupNewsURL config, containes win/beta in a service install, invalid update type");
logger.info("updated routerconsole.browser config " + appImageExe()); if (i2pRouter.saveConfig("router.backupNewsURL",
ServiceUpdaterString())) {
logger.info("updated routerconsole.browser config " +
appImageExe());
}
} }
} }
String updateURL = i2pRouter.getConfig("router.updateURL") String updateURL = i2pRouter.getConfig("router.updateURL");
if (updateURL if (updateURL != null) {
.contains("i2pwinupdate.su3")) { if (updateURL.contains("i2pwinupdate.su3")) {
logger.info( logger.info(
"checked router.updateURL config, containes win/beta in a service install, invalid update type"); "checked router.updateURL config, containes win/beta in a service install, invalid update type");
if (i2pRouter.saveConfig("router.updateURL", if (i2pRouter.saveConfig("router.updateURL",
ServerStaticUpdaterString())) { ServerStaticUpdaterString())) {
logger.info("updated routerconsole.browser config " + appImageExe()); logger.info("updated routerconsole.browser config " +
appImageExe());
}
} }
} }
} }