Skip to content
Snippets Groups Projects
Commit 5e7e23a0 authored by tobias's avatar tobias
Browse files

Change UpdateRegistery#needsAdminPermission

parent 78ff31f7
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
import de.tobias.utils.util.OS;
import de.tobias.utils.util.SystemUtils;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
......@@ -41,8 +42,6 @@ public class UpdateRegistery {
private static final String URL = "url";
private static final String EXECUTE_FILE = "executePath";
public static String buildParamaterString(String downloadPath) {
JSONObject data = new JSONObject();
data.put(DOWNLOAD_PATH, downloadPath);
......@@ -70,6 +69,13 @@ public class UpdateRegistery {
if (!Files.isWritable(updatable.getLocalPath())) {
return true;
}
if (OS.isWindows()) {
try {
if (Files.getOwner(updatable.getLocalPath()).getName().toLowerCase().contains("admin")) {
return true;
}
} catch (IOException e) {}
}
}
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment