Application Copies Running Simultaneously
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Application Copies Running Simultaneously
Hello
Is it possible to limit the number of times an application can run simultaneously on the same computer?
I mean, if I duplicate my compiled application I can run both copies (original and copy) at the same time. Is it possible to avoid duplicated applications from running simultaneously?
Thanks
Andres
Is it possible to limit the number of times an application can run simultaneously on the same computer?
I mean, if I duplicate my compiled application I can run both copies (original and copy) at the same time. Is it possible to avoid duplicated applications from running simultaneously?
Thanks
Andres
Hi Andres,
If you have Revolution 2.7.3 or later, you can invoke the relaunch message on Windows.
"Upon launching a Revolution application with such a 'relaunch' handler, the
engine searches for a unique token to see if it is already running. If it
is, the new instance sends a 'relaunch' message to the existing instance.
The existing instance can do the following with this message:
1) If it is passed, then the new instance continues running.
2) If "background" is returned, then the new instance is terminated.
3) If nothing is returned but the message is not passed, then the new
instance is terminated and the existing instances 'defaultStack' is made
the foreground window." (from the file Whats_New.txt).
To find out how this works exactly, read the change log for Rev 2.7.3 in Whats_New.txt. Search for "relaunch".
Best,
Mark
If you have Revolution 2.7.3 or later, you can invoke the relaunch message on Windows.
"Upon launching a Revolution application with such a 'relaunch' handler, the
engine searches for a unique token to see if it is already running. If it
is, the new instance sends a 'relaunch' message to the existing instance.
The existing instance can do the following with this message:
1) If it is passed, then the new instance continues running.
2) If "background" is returned, then the new instance is terminated.
3) If nothing is returned but the message is not passed, then the new
instance is terminated and the existing instances 'defaultStack' is made
the foreground window." (from the file Whats_New.txt).
To find out how this works exactly, read the change log for Rev 2.7.3 in Whats_New.txt. Search for "relaunch".
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Andres,
AFAIK this problem doesn't exist on Mac OS X (unless you run standalones as GUI-less shell commands).
Best,
Mark
AFAIK this problem doesn't exist on Mac OS X (unless you run standalones as GUI-less shell commands).
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hello Mark
All standalones I have made for OS X can run multiple times on the same computer.
I don't know if you can try it, but get one, duplicated it (either while running or not) and try to run both. You will see that each one runs as a separate application.
Am I missing something at the compilation settings?
I found a way to quit a second instance by using a shell command, but it is not the best way to do it.
Regards,
Andres
All standalones I have made for OS X can run multiple times on the same computer.
I don't know if you can try it, but get one, duplicated it (either while running or not) and try to run both. You will see that each one runs as a separate application.
Am I missing something at the compilation settings?
I found a way to quit a second instance by using a shell command, but it is not the best way to do it.
Regards,
Andres
Hi Andres,
I understand what you mean now. This is normal. Why would you want to change it? If necessary, just put into the Read Me file: "Do not try to run duplicate copies of this application."
On Windows, the problem is a real one, because applications can run twice, even if there is only one copy.
On Mac OS X, this gives you a complete list of processes:
You can have the new instance of the programme check whether an older instance is running already, using the output from above shell function. If an older instance is running already, simply quit the new instance. No need for (slow) AppleScript.
Best,
Mark
I understand what you mean now. This is normal. Why would you want to change it? If necessary, just put into the Read Me file: "Do not try to run duplicate copies of this application."
On Windows, the problem is a real one, because applications can run twice, even if there is only one copy.
On Mac OS X, this gives you a complete list of processes:
Code: Select all
put shell("ps ux -a -c -w -w")
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Andres,
shell("tasklist") will give you a list of processes on Windows XP and possibly on Vista. I don't know on which other Windows versions this might work, it definitely doesn't work on Win 95.
Best,
Mark
shell("tasklist") will give you a list of processes on Windows XP and possibly on Vista. I don't know on which other Windows versions this might work, it definitely doesn't work on Win 95.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode