Page 1 of 1

Rename when it is in process??

Posted: Tue Jan 11, 2011 4:02 am
by alemrantareq
Hi everybody, How are you? Hope fine. I use rev ent 4.0 & I wonder that application made by rev can be renamed while it's in process. How is it possible & how could I stop this? :?

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 11:53 am
by Klaus
Hi,
alemrantareq wrote:I use rev ent 4.0 & I wonder that application made by rev can be renamed while it's in process. How is it possible...
I have no idea, but I think this is an OS issue.
alemrantareq wrote:...how could I stop this? :?
You can't! Simply because you cannot control the users behavior outside of your app! 8)


Best

Klaus

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 3:05 pm
by alemrantareq
Klaus wrote:....You can't! Simply because you cannot control the users behavior outside of your app!
But the other applications except rev can't rename while they're in process. :shock:

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 3:16 pm
by kray
Can I ask why you need to rename a running Rev app?

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 4:48 pm
by alemrantareq
No, I've no need to rename running rev app, rather I need to prevent it, because I'm developing a program, and if you rename & run it while it's in process, it'll cause program crashes.

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 5:33 pm
by dunbarx
Wouldn't setting the cantModify property do the trick?

Craig Newman

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 5:39 pm
by Klaus
I am sure he means renaming the app/exe in the FInder/Explorer while it is running.

I personally would not care, if the user of my app wants to do something dumb, hey, its her/his machine 8)
Free will(y) etc... :D


Best

Klaus

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 6:44 pm
by wsamples
Do you know why it crashes after the renaming? Perhaps there's a way to address that. For instance, if you've stored a reference to the app folder name before the name change that reference will no longer work but as inelegant as it may feel, doing the whole process of discovering the actual current location every time you need to use it should prevent that particular problem. Maybe just another silly question, but how did this issue occur to you? Ordinarily it would seem an extremely unusual thing for a user to be doing. Is there something about your app's function that would make this more likely than usual?

Re: Rename when it is in process??

Posted: Tue Jan 11, 2011 7:27 pm
by alemrantareq
I'm working with some font fixing issues. Before my app open, it checks some errors; so while it is already in process to fix the errors, if any user rename & run it twice then it'll surely can't do the script well as well as the system will be crashed.

cantModify property not works in this issue. Does address property could help? How? Please, give me a sample. Thanks....

Re: Rename when it is in process??

Posted: Wed Jan 12, 2011 4:30 am
by kray
When does your stack crash after it's been renamed? On the next user action or only on certain actions?

Re: Rename when it is in process??

Posted: Wed Jan 12, 2011 7:06 am
by alemrantareq
I've made a script which will check before starting whether the imagename of the app exists in the tasklist or not; if exists it'll show an error message & quit, but not the previous one. To make this script applicable, I don't want to let the users to rename while its running. Because if it's renamed & run, it'll show the renamed image in the tasklist checking that the app is not running in memory.

Re: Rename when it is in process??

Posted: Wed Jan 12, 2011 2:56 pm
by kray
So is this the scenario you're trying to prevent?
  1. User launches "Foo.exe", check function runs
  2. While "Foo.exe" is in the list of running processes, user renames app to "Bar.exe"
  3. User launches "Bar.exe"
  4. A second instance of the app is launched and runs the check function again, creating a crash
Of so, have you tried using a "relaunch" message trap (see "relaunch" in the LC docs). I know it works with a mutex, but I'm not sure if the relaunch handler will trigger if the app is renamed...

Re: Rename when it is in process??

Posted: Wed Jan 12, 2011 5:02 pm
by alemrantareq
Thanks kray, relaunch message works perfectly even the app name is renamed. :D

Re: Rename when it is in process??

Posted: Wed Jan 12, 2011 7:26 pm
by Klaus
Ah, good to know that the name of an app/exe in the Finder/Desktop is just a "Label" and not the "real" process name!

Re: Rename when it is in process??

Posted: Wed Jan 12, 2011 11:19 pm
by kray
Nice! Wasn't sure that would work, but in retrospect it makes sense (each app has a unique GUID, so even if renamed the GUID would be the same).