卸载时退出所有node.js进程

This commit is contained in:
yi-ge 2019-09-02 19:16:12 +08:00
parent 2d1337f044
commit 524d7fe186

View File

@ -112,8 +112,8 @@ namespace setup
ll = pro.StandardOutput.ReadToEnd() + pro.StandardError.ReadToEnd(); //读取输出 ll = pro.StandardOutput.ReadToEnd() + pro.StandardError.ReadToEnd(); //读取输出
pro.WaitForExit(); //等待程序执行完退出进程 pro.WaitForExit(); //等待程序执行完退出进程
pro.Close();//结束 pro.Close();//结束
return ll; return ll;
} }
catch (Exception ex) catch (Exception ex)
@ -334,8 +334,8 @@ SOFTWARE.");
else else
{ {
Console.WriteLine("What do you want to do?"); Console.WriteLine("What do you want to do?");
Console.WriteLine("1) Install (I accept the MIT License.)"); Console.WriteLine("1) Install (I accept the MIT License)");
Console.WriteLine("2) Uninstall"); Console.WriteLine("2) UninstallWill exit the Node.js process");
Console.WriteLine("3) Exit"); Console.WriteLine("3) Exit");
Console.Write("#?"); Console.Write("#?");
cmd = Console.ReadLine(); cmd = Console.ReadLine();
@ -398,6 +398,7 @@ SOFTWARE.");
{ {
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "stop")); Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "stop"));
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "remove")); Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "remove"));
runCmd("taskkill /fi \"imagename eq node.exe\" /f");
Thread.Sleep(1500); Thread.Sleep(1500);