prepare to try and probe a windows service from Java

This commit is contained in:
idk
2022-09-19 00:26:52 -04:00
parent e09f05ce42
commit 280588dee4
2 changed files with 14 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package net.i2p.router;
import java.io.*;
import java.util.Map;
import java.util.function.*;
import net.i2p.I2PAppContext;
import net.i2p.router.*;
@@ -43,15 +44,15 @@ class WinUpdateProcess implements Runnable {
if (file == null)
return;
var workingDir = workDir();
var logFile = new File(workingDir, "log-" + version + ".txt");
File workingDir = workDir();
File logFile = new File(workingDir, "log-" + version + ".txt");
if (logFile.canWrite()) {
// check if we can write to the log file. If we can, use the
// ProcessBuilder to run the installer.
ProcessBuilder pb = new ProcessBuilder(
file.getAbsolutePath(), "/S", "/D=" + workingDir.getAbsolutePath());
var env = pb.environment();
Map<String, String> env = pb.environment();
env.put("OLD_I2P_VERSION", version);
env.remove("RESTART_I2P");