Prefer Process Builder

This commit is contained in:
Konloch 2021-07-19 06:23:42 -07:00
parent f21cf41455
commit c70c052f53

View file

@ -57,15 +57,20 @@ public class Constants
//hides the BCV directory //hides the BCV directory
if (isWindows() && !BCVDir.isHidden()) if (isWindows() && !BCVDir.isHidden())
{ {
new Thread(()->{
try { try {
BytecodeViewer.sm.pauseBlocking(); BytecodeViewer.sm.pauseBlocking();
// Hide file by running attrib system command (on Windows) // Hide file by running attrib system command (on Windows)
Runtime.getRuntime().exec("attrib +H " + BCVDir.getAbsolutePath()); Process p = new ProcessBuilder("attrib",
"+H",
BCVDir.getAbsolutePath()).start();
} catch (Exception e) { } catch (Exception e) {
//ignore //ignore
} finally { } finally {
BytecodeViewer.sm.resumeBlocking(); BytecodeViewer.sm.resumeBlocking();
} }
}, "Hide BCV Dir").start();
} }
return BCVDir.getAbsolutePath(); return BCVDir.getAbsolutePath();