[SOLVED] How do I move my running app?
[SOLVED] How do I move my running app?
- Subject: [SOLVED] How do I move my running app?
- From: "Alan Smith" <email@hidden>
- Date: Wed, 5 Jul 2006 11:54:49 -0400
Thanks again everyone,
That system call didn't work out so well so my program now just copies
the app and deletes the old one, all of it done with NSFileManager, a
very close friend of mine. This may not seem too safe, and it doesn't,
but it doesn't seem to have any affect on my app. The best part, I
don't have to restart the app, which was the slowest part.
To answer your question Uli, I have just created the folder
programmaticly when I move my app so I know the exact name of the
folder.
Cheers, Alan
On 7/4/06, Andrew Farmer <email@hidden> wrote:
On 04 Jul 06, at 17:59, Uli Kusterer wrote:
> 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.
And/or a helper app.
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"Don't waste your life doing things others have already done."
_______________________________________________
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