Page 1 of 1

how to check program already running?

Posted: Mon May 24, 2021 7:56 pm
by MaxV
Hello,
I created an access control time and attendance for my company using livecode.
It automatically starts when the user login successfully.
I want to add to the program a check that verify if it is already launched. So he use can't run more than an instance of the program.
just to give yo the whole picture:
  • windows server
  • user login in and so he automatically starts my "check Presence" program. The program will run until the user is working.
  • at startup it should check program should check if it's already started, in this case "quit". How to do it?
I would not rely on external files (for example at startup write a file "running"), because in case of failures the file would remain there and the program will never start again.

Do you have any suggestion?

Re: how to check program already running?

Posted: Mon May 24, 2021 8:07 pm
by bogs
Heya Max, long time no see :)
I created an access control time and attendance for my company using livecode.
If your starting the program using a livecode program, perhaps "open process" and "openProcesses" is what your looking for?

Re: how to check program already running?

Posted: Mon May 24, 2021 8:21 pm
by SparkOut
Actually you should handle (or not, if desired) the "relaunch" message to control what happens when someone instigates another opening of the same stack.

Re: how to check program already running?

Posted: Sat May 29, 2021 7:59 am
by stam
SparkOut wrote:
Mon May 24, 2021 8:21 pm
Actually you should handle (or not, if desired) the "relaunch" message to control what happens when someone instigates another opening of the same stack.
+1 !