diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java
index 6bfacda4b..0d39c0465 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java
@@ -1,8 +1,9 @@
package net.i2p.router.web;
+import java.io.IOException;
+
import net.i2p.router.ClientTunnelSettings;
import net.i2p.router.Router;
-
import net.i2p.apps.systray.SysTray;
import org.tanukisoftware.wrapper.WrapperManager;
@@ -39,6 +40,10 @@ public class ConfigServiceHandler extends FormHandler {
} else if ("Hard restart".equals(_action)) {
_context.router().shutdown(Router.EXIT_HARD_RESTART);
addFormNotice("Hard restart requested");
+ } else if ("Run I2P on startup".equals(_action)) {
+ installService();
+ } else if ("Don't run I2P on startup".equals(_action)) {
+ uninstallService();
} else if ("Dump threads".equals(_action)) {
try {
WrapperManager.requestThreadDump();
@@ -74,4 +79,21 @@ public class ConfigServiceHandler extends FormHandler {
addFormNotice("Blah blah blah. whatever. I'm not going to " + _action);
}
}
-}
+
+ private void installService() {
+ try {
+ Runtime.getRuntime().exec("install_i2p_service_winnt.bat");
+ addFormNotice("Service installed");
+ } catch (IOException ioe) {
+ addFormError("Warning: unable to install the service - " + ioe.getMessage());
+ }
+ }
+ private void uninstallService() {
+ try {
+ Runtime.getRuntime().exec("uninstall_i2p_service_winnt.bat");
+ addFormNotice("Service removed");
+ } catch (IOException ioe) {
+ addFormError("Warning: unable to remove the service - " + ioe.getMessage());
+ }
+ }
+}
\ No newline at end of file
diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp
index c701abdab..338e669ba 100644
--- a/apps/routerconsole/jsp/configservice.jsp
+++ b/apps/routerconsole/jsp/configservice.jsp
@@ -39,18 +39,15 @@
If you are on windows, you can either enable or disable that icon here.
-
+ <% } %>
With the I2P install we've bundled some scripts and code (from the cool folks at tanukisoftware) to let you -run I2P as a service on windows machines (a daemon, for you *nix geeks). To install it, -just run install_i2p_service_winnt.bat (or install_i2p_service_unix, as root). To uninstall -it, run uninstall_i2p_service_winnt.bat (or uninstall_i2p_service_unix, as root). To uninstall -I2P altogether, simply wipe the I2P installation directory.
+run I2P as a service on windows machines (a daemon, for you *nix geeks). Windows users can +add or remove the I2P service on the service control page, or +through the install_i2p_service_winnt.bat and uninstall_i2p_service_winnt.bat scripts. *nix +users can use the install_i2p_service_unix and uninstall_i2p_service_unix scripts included, but +they must be run as root. To uninstall I2P altogether, simply wipe the I2P installation +directory.