This is an old topic.
Nevertheless I tried the UniqueInstance. It works well. The component is however not standard available in Lazarus. The same setup is easy to implement with the simpleIPCserver. This allows customization. Attached my simple implementation including the sending of paramstr(1) from the second instance to the first instance prior to termination.
I don't understand why in UniqueInstance the OnMessage event in combination with a timer is used. With an onMessageQueued event it is possible to implement it without a timer. I will post an issue at Github,
https://github.com/blikblum/luipack/tree/master/uniqueinstance.
Later:
Sending parameters only worked in Windows. For Linux there is no onMessageQueued event. If have do a SimpleIPCServer1.PeekMessage(1,True) driven by timer.
Attached an version which works both for Linux and Windows. The Linux part is timer driven.
Han