在服务模块中加入以下代码
procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject);
begin
CreateMutex(nil, FALSE, 'Project1'); //uses Winapi.Windows
if GetLastError = ERROR_ALREADY_EXISTS then
begin
//Application.Terminate;
ExitProcess(0); //新版本有效
end;
end;