(* 给你弄个比较简单的方案吧。使用没问题。 至于如何杀进程,网上代码多如牛毛,只是你懒得搜而已 *){程序A:} if True then begin {如果检测到可用更新} ShellApi.ShellExecute(0, PChar('Open'), PChar('B.exe'), nil, PChar('c:\Test\'), SW_SHOWNORMAL); Application.Terminate; end;{程序B:} if True then begin {如果更新下载完毕} ShellApi.ShellExecute(0, PChar('Open'), PChar('A.exe'), nil, PChar('c:\Test\'), SW_SHOWNORMAL); Application.Terminate; end;{注意,A、B两个程序放在C:\Test目录下使用。}
关键是 更新程序B启动时,杀掉A程序的进程这一步时,如何去杀A程序,A和B有什么关系,用什么方式去实现最适用?
能写一段代码吗?》
ShellApi.ShellExecute(0, PChar('Open'), PChar('B.exe'), nil, PChar('c:\Test\'), SW_SHOWNORMAL);
Application.Terminate;
end;{程序B:} if True then begin {如果更新下载完毕}
ShellApi.ShellExecute(0, PChar('Open'), PChar('A.exe'), nil, PChar('c:\Test\'), SW_SHOWNORMAL);
Application.Terminate;
end;{注意,A、B两个程序放在C:\Test目录下使用。}