Windows works!
This commit is contained in:
parent
4b6a4372d9
commit
8ee712e81a
@ -378,17 +378,19 @@ do_gajudesk() ->
|
|||||||
GajuDesk = "zx run gajudesk",
|
GajuDesk = "zx run gajudesk",
|
||||||
Command =
|
Command =
|
||||||
case os:type() of
|
case os:type() of
|
||||||
{unix, _} ->
|
{unix, _} -> detach_unix(GajuDesk);
|
||||||
"setsid sh -c 'exec nohup " ++ GajuDesk ++ " >/dev/null 2>&1' &";
|
{win32, nt} -> detach_windows(GajuDesk)
|
||||||
{win32, nt} ->
|
|
||||||
"wscript //B //Nologo "
|
|
||||||
"-e:VBScript "
|
|
||||||
"-c:\"CreateObject(\"WScript.Shell\").Run \"\""
|
|
||||||
" \"" ++ GajuDesk ++ "\", 0, False\""
|
|
||||||
end,
|
end,
|
||||||
Out = os:cmd(Command),
|
Out = os:cmd(Command),
|
||||||
log(info, "os:cmd(~s) -> ~s", [Command, Out]).
|
log(info, "os:cmd(~s) -> ~s", [Command, Out]).
|
||||||
|
|
||||||
|
detach_unix(Command) ->
|
||||||
|
"setsid sh -c 'exec nohup " ++ Command ++ " >/dev/null 2>&1' &".
|
||||||
|
|
||||||
|
detach_windows(Command) ->
|
||||||
|
PSCmd = "Start-Process -WindowStyle Hidden -FilePath cmd.exe -ArgumentList '/c " ++ Command ++ "'",
|
||||||
|
"powershell -NoProfile -Command \"" ++ PSCmd ++ "\"".
|
||||||
|
|
||||||
|
|
||||||
run_gmc_conf(State = #s{gmc_conf = none, network = Net, acc = Acc, keys = Keys,
|
run_gmc_conf(State = #s{gmc_conf = none, network = Net, acc = Acc, keys = Keys,
|
||||||
max_cores = MProcs, max_mem = MMem,
|
max_cores = MProcs, max_mem = MMem,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user