Re: How do I move my running app?
Re: How do I move my running app?
- Subject: Re: How do I move my running app?
- From: Uli Kusterer <email@hidden>
- Date: Wed, 5 Jul 2006 02:59:17 +0200
Am 04.07.2006 um 16:58 schrieb Alan Smith:
setenv("OLD_LAUNCH_PATH", [[[NSBundle mainBundle] bundlePath]
UTF8String], 1);
setenv("NEW_LAUNCH_PATH", [@"/Users/EV Manager.app" UTF8String],
2);
system("/bin/bash -c '{ for (( i = 0; i < 3000 && $(echo $(/bin/ps
-xp $PPID|/usr/bin/wc -l))-1; i++ )); do\n"
" /bin/sleep .2;\n"
" done\n"
" mv \"${OLD_LAUNCH_PATH}\" \"${NEW_LAUNCH_PATH}\"\n"
" if [[ $(/bin/ps -xp $PPID|/usr/bin/wc -l) -ne 2 ]];
then\n"
" /usr/bin/open \"${NEW_LAUNCH_PATH}\"\n"
" fi\n"
"} &>/dev/null &'");
[[NSApplication sharedApplication] terminate:self];
So, what happens when the folder the app is in has a name that
contains the quote character? In this case, I'd really suggest using
Carbon's FSMoveObject and Launch Services instead.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden