This commit is contained in:
crschnick
2025-08-10 01:58:26 +00:00
parent 7c6834bae6
commit b73bbd1f59
4 changed files with 11 additions and 4 deletions

View File

@@ -37,6 +37,14 @@ public interface AppLocations {
private Path userHome;
public Path getSystemRoot() {
var root = AppLocations.parsePath(System.getenv("SystemRoot"));
if (root == null) {
return Path.of("C:\\Windows");
}
return root;
}
public Path getTemp() {
var env = AppLocations.parsePath(System.getenv("TEMP"));
if (env == null) {

View File

@@ -42,8 +42,6 @@ public class AppSid {
return;
}
if (true) return;
try {
// If there is no setsid command, we can't fully prevent commands from accessing any potential parent tty
// We can however set the pid to prevent this happening when launched from the cli command

View File

@@ -1,5 +1,6 @@
package io.xpipe.app.core.check;
import io.xpipe.app.core.AppLocations;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.process.ShellDialects;
import io.xpipe.app.util.LocalShell;
@@ -10,7 +11,7 @@ import java.util.concurrent.TimeUnit;
public class AppCertutilCheck {
private static boolean getResult() {
var fc = new ProcessBuilder(System.getenv("WINDIR") + "\\System32\\certutil").redirectErrorStream(true);
var fc = new ProcessBuilder(AppLocations.getWindows().getSystemRoot().resolve("\\System32\\certutil").toString()).redirectErrorStream(true);
try {
var proc = fc.start();
var out = new String(proc.getInputStream().readAllBytes());

View File

@@ -47,7 +47,7 @@ public interface ExternalEditorType extends PrefsChoiceValue {
@Override
public Optional<Path> determineInstallation() {
return Optional.of(Path.of(System.getenv("SystemRoot") + "\\System32\\notepad.exe"));
return Optional.of(AppLocations.getWindows().getSystemRoot().resolve("\\System32\\notepad.exe"));
}
};