mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-30 04:00:50 +01:00
Fix for certificatePath which includes spaces
This commit is contained in:
parent
b1f86aa80b
commit
3d6e7d5b32
@ -25,7 +25,7 @@ public class NitroWindows implements NitroOsFunctions {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isRootCertificateTrusted(File certificate) {
|
public boolean isRootCertificateTrusted(File certificate) {
|
||||||
try {
|
try {
|
||||||
final String output = RuntimeUtil.getCommandOutput(new String[] {"cmd", "/c", " certutil.exe -f -verify " + certificate.getAbsolutePath()});
|
final String output = RuntimeUtil.getCommandOutput(new String[] {"cmd", "/c", " certutil.exe -f -verify \"" + certificate.getAbsolutePath() + "\""});
|
||||||
|
|
||||||
return !output.contains("CERT_TRUST_IS_UNTRUSTED_ROOT") &&
|
return !output.contains("CERT_TRUST_IS_UNTRUSTED_ROOT") &&
|
||||||
output.contains("dwInfoStatus=10c dwErrorStatus=0");
|
output.contains("dwInfoStatus=10c dwErrorStatus=0");
|
||||||
@ -41,7 +41,7 @@ public class NitroWindows implements NitroOsFunctions {
|
|||||||
final String certificatePath = certificate.getAbsolutePath();
|
final String certificatePath = certificate.getAbsolutePath();
|
||||||
|
|
||||||
// Prompt UAC elevation.
|
// Prompt UAC elevation.
|
||||||
WinDef.HINSTANCE result = NitroWindowsShell32.INSTANCE.ShellExecuteA(null, "runas", "cmd.exe", "/S /C \"certutil -addstore root " + certificatePath + "\"", null, 1);
|
WinDef.HINSTANCE result = NitroWindowsShell32.INSTANCE.ShellExecuteA(null, "runas", "cmd.exe", "/S /C 'certutil -addstore root \"" + certificatePath + "\"'", null, 1);
|
||||||
|
|
||||||
// Wait for exit.
|
// Wait for exit.
|
||||||
Kernel32.INSTANCE.WaitForSingleObject(result, WinBase.INFINITE);
|
Kernel32.INSTANCE.WaitForSingleObject(result, WinBase.INFINITE);
|
||||||
|
Loading…
Reference in New Issue
Block a user