我正在为Windows服务写一个autoupdater。这是我想要的工作(请让我知道如果有一个更好的解决方案)父进程退出后保持子进程生效
1) The service launches a child Process (the updater).
2) The child stops the parent service (I'm using sc.exe).
3) The child applies the updated .exe and .dll files for the parent.
4) The child starts the parent service.
我卡在#2,因为当我停止父服务的子进程被终止。我如何在C#中启动一个不是子进程的新进程,它本身就是存在的?
是从运行不同:方法P =新工艺(); p.start(); ??我的理解是这种方式创建了一个子进程。 – Matthew
我不确定这将在随后被停止的服务中起作用。 –
是的,他们是不同的。以这种方式启动类似于从“运行”对话框启动某些内容。它没有与其父母关联。如果你转向MSDN,他们会详细解释过载之间的区别。 – Mrchief