Make sure that only one instance of the application is running on the system.
Questions tagged [single-instance]
250 questions
10
votes
7 answers
How to implement single instance per machine application?
I have to restrict my .net 4 WPF application so that it can be run only once per machine. Note that I said per machine, not per session.
I implemented single instance applications using a simple mutex until now, but unfortunately such a mutex is per…

Marc
- 9,012
- 13
- 57
- 72
9
votes
3 answers
PyQt - how to detect and close UI if it's already running?
I'm starting the UI from within Maya. If the UI hasn't been closed, running the UI again will completely freeze Maya (with the error "Event Loop is already running")
Manually closing the UI before re-running the script will prevent it from freezing…

Panupat
- 452
- 6
- 21
9
votes
1 answer
Android Deep linking and singleInstance/singleTask
Possible Duplicate Deep linking and multiple app instances. I have implemented Deep Linking in my app. I have Splash activity that is launcher and MainActivity that handles the Intent as defined in manifest:

Nouman Bhatti
- 1,777
- 4
- 28
- 55
9
votes
1 answer
Android singletop singleinstance and singletask
I've an design issue in implementing different types of launchmode for different activities. I've 5 Activities.
VideoList
VideoDetail
FavoritesList
VideoSearch
VideoPlayer
When the user starts the app it goes to VideoList that displays list of…

user278445
- 271
- 5
- 7
8
votes
8 answers
Restrict multiple instances of an application in java
I want to prevent multiple instances of application being launched in java. I know 2 methods for this:
locking file
locking socket
But which is one is more efficient and good to use? Which one should I use?
Any other solution to do the same are…

Harry Joy
- 58,650
- 30
- 162
- 207
8
votes
2 answers
Allow only one application instance
I'm sorry about my title may be it make you confusing (it's just I don't know what words should I use). My problem is I don't want to allow user to open my application multiple time. Please help. Thank you in advance.

Norak
- 448
- 1
- 9
- 22
8
votes
2 answers
android singleinstance activity not single if back button pressed
I encountered an interesting issue, where an Activity is created multiple times, even it is defined as a singleTask or a singelInstance Activity in the manifest. Here is how this can be reproduced. Say, in the main activity:
@Override
protected void…

Ákos Maróy
- 919
- 2
- 10
- 19
7
votes
5 answers
Kotlin: Java can't resolve Kotlin Symbol?
I have a Kotlin Code just like the below, SingleKotlin.instance can be called by the other Kotlin files
class SingleKotlin private constructor(){
companion object {
val instance by lazy {
SingleKotlin()
}
…

user3239558
- 1,757
- 4
- 18
- 31
7
votes
11 answers
How to make sure that there is one instance of the application is running
I want to check when the user double click on applictaion icon that no another instance of this application is already running.
I read about My.Application but i still don't know what to do.

BDeveloper
- 1,175
- 6
- 24
- 44
7
votes
3 answers
How should I scope dependency injection of Entity Framework DbContext in a web app? (InstancePerHttpRequest vs SingleInstance)
I have read that DbContext object should be created as InstancePerHttpRequest, not SingleInstance, because of its thread-unsafe nature and it might consume too much resource between requets which makes sence.
But I am using Repository objects which…

Mert Sakarya
- 105
- 1
- 5
6
votes
2 answers
Single instance of a Java desktop application with argument passing
I'd like only a single instance of my Java Swing application to run at a time. If a second instance is opened, I would like it to pass its arguments to the instance already running. How can I do this using a nice, clean Java API? (I'd prefer not to…

peskal
- 1,213
- 1
- 12
- 28
6
votes
4 answers
Django "Singleton model" to store user settings
I am building a web app with Django. I would like to be able to store final user settings for my app. For now I am using a model Settings that contains all what I need for the app.
It seems ok but I don't think that's the right way to do it because…

Louison Diogo
- 63
- 1
- 4
6
votes
1 answer
C# dot net core single instance app passing parameters to first instance
Recently I decided to migrate one of my WPF Windows desktop apps written in C# and targeting .NET Framework 4.5 to the newest .NET Core 3.1. All was good until I had to add support for single instance application while being able to pass any…

Alexandru Dicu
- 1,151
- 1
- 16
- 24
6
votes
2 answers
boost::interprocess::named_mutex vs CreateMutex
I want to switch from CreatMutex to boost::interprocess::named_mutex to limit my application to a single instance. Both methods works when the application runs and ends just fine. However, the lock is not released when the application crashes and…

andre
- 7,018
- 4
- 43
- 75
5
votes
1 answer
Ways to achieve de-duplicated file storage within Amazon S3?
I am wondering the best way to achieve de-duplicated (single instance storage) file storage within Amazon S3. For example, if I have 3 identical files, I would like to only store the file once. Is there a library, api, or program out there to help…

ebeland
- 1,543
- 10
- 21