Hi, as the title suggests, I am looking for a non-engine solution to disallow multiple instances of the packaged Desktop build. I have followed a code from this [Content removed] but unfortunately, it locks up the game during editor playtestings, so that is non so viable. (Implemented in our game instance Init())
Are there any other methods to check or override to stop the user from being able to launch multiple instances of the game?
[Attachment Removed]
Hi,
The thread you linked gives you the right answer. On Windows, if you want a single instance of an application, using a system named mutex is the common one. If you are concerned by the Editor, you could wrap the code with:
#if !WITH_EDITOR
#endif
Or simply add a global define to your game Target.cs. (ex D:\UE_5.6\Samples\Games\Lyra\Source\LyraGame.Target.cs)
Target.GlobalDefinitions.Add("UE_SINGLE_INSTANCE_APP=1");Then surround your special code with:
#ifdef UE_SINGLE_INSTANCE_APP && UE_SINGLE_INSTANCE_APP==1
// Use the code in the thread.
#endif
Regards,
Patrick
[Attachment Removed]