Reign in some of the insanity
This commit is contained in:
@ -12,7 +12,7 @@ import java.util.logging.FileHandler;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class CopyConfigDir extends WindowsServiceUtil {
|
||||
public class CopyConfigDir extends WindowsAppUtil {
|
||||
final Log logger;
|
||||
|
||||
public CopyConfigDir(RouterContext ctx) {
|
||||
|
@ -24,11 +24,11 @@ import net.i2p.util.Log;
|
||||
* appdata
|
||||
* router.pid - the pid of the java process.
|
||||
*/
|
||||
public class WinLauncher extends WindowsServiceUtil {
|
||||
public class WinLauncher extends WindowsAppUtil {
|
||||
private final CopyConfigDir copyConfigDir;
|
||||
WindowsUpdatePostProcessor wupp = null;
|
||||
private final Router i2pRouter;
|
||||
final Log logger;
|
||||
private final Log logger;
|
||||
public WinLauncher() {
|
||||
i2pRouter = new Router(routerConfig(), System.getProperties());
|
||||
copyConfigDir = new CopyConfigDir(i2pRouter.getContext());
|
||||
@ -115,7 +115,7 @@ public class WinLauncher extends WindowsServiceUtil {
|
||||
|
||||
// This actually does most of what we use NSIS for if NSIS hasn't
|
||||
// already done it, which essentially makes this whole thing portable.
|
||||
if (!launcher.copyConfigDir()) {
|
||||
if (!launcher.copyConfigDir.copyConfigDir()) {
|
||||
launcher.logger.error("Cannot copy the configuration directory");
|
||||
System.exit(1);
|
||||
}
|
||||
@ -188,15 +188,6 @@ public class WinLauncher extends WindowsServiceUtil {
|
||||
return portFree;
|
||||
}
|
||||
|
||||
private void setNotStarting() {
|
||||
logger.info("removing startup file, the application has started");
|
||||
File home = selectHome();
|
||||
File starting = new File(home, "starting");
|
||||
if (starting.exists()) {
|
||||
starting.delete();
|
||||
}
|
||||
}
|
||||
|
||||
private final Runnable REGISTER_UPP = () -> {
|
||||
RouterContext ctx;
|
||||
while ((ctx = i2pRouter.getContext()) == null) {
|
||||
|
@ -4,11 +4,6 @@ import java.io.File;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
final Log logger;
|
||||
public WindowsAppUtil(RouterContext ctx) {
|
||||
super();
|
||||
logger = ctx.logManager().getLog(WindowsAppUtil.class);
|
||||
}
|
||||
protected File selectHome() { // throws Exception {
|
||||
String path_override = System.getenv("I2P_CONFIG");
|
||||
if (path_override != null) {
|
||||
@ -21,7 +16,6 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
}
|
||||
}
|
||||
File i2p = appImageHome();
|
||||
logger.info("Checking for signs of life in I2P_CONFIG directory: " + i2p);
|
||||
return i2p;
|
||||
}
|
||||
|
||||
@ -37,7 +31,6 @@ public class WindowsAppUtil extends WindowsServiceUtil {
|
||||
}
|
||||
}
|
||||
File i2p = appImageHome();
|
||||
logger.info("Checking for signs of life in I2P directory: " + i2p);
|
||||
return i2p;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user