Re: launching app post-install in leopard
Re: launching app post-install in leopard
- Subject: Re: launching app post-install in leopard
- From: "Adam Fisk" <email@hidden>
- Date: Thu, 6 Dec 2007 22:25:55 +0530
Quick followup on this. It turns out I was wrong about the cause --
all my checks with xattr passed no problem -- the plist file was not
actually marked as quarantined.
Rather, I was experiencing a new user ID check in Leopard where calls
to launchctl are checked to make sure the file has the same owner as
the caller. The problem was the installed plist file was owned by the
user, whereas the installer was running under sudo (to my dismay, I
had to make the installer run as administrator at one point).
I ultimately had to add the following to my postflight script:
if ! chown root org.lastbamboo.littleshoot.plist
then
echo "Could not take root ownership of plist!!"
exit 1
fi
Since postflight is running as root, this succeeds, and the installer
runs no problem! Interestingly, I believe this means launchctl may be
a workaround for launching the app after install.
One caveat though -- I'm actually still only testing locally. It's
very possible *I'll also have to implement your fix Martin* once I
actually am downloading the installer. I'll know soon.
Thanks again. Hope this is helpful to someone else. Oh, the new
snippet from darwin I ran into is here:
if (sb.st_uid != 0 && sb.st_uid != getuid()) {
fprintf(stderr, "%s: Dubious ownership on file (skipping): %s\n",
getprogname(), path);
return false;
}
-Adam
On Nov 28, 2007 9:33 PM, Adam Fisk <email@hidden> wrote:
> Interesting. Sounds very promising, Martin -- thanks. I'll give it a try.
>
> -Adam
>
>
>
> On Nov 28, 2007 7:41 PM, Martin Bestmann <email@hidden> wrote:
> >
> > On 27.11.2007, at 13:16, Adam Fisk wrote:
> >
> > > Someone mentioned the issue with not being able to call "open
> > > myApp.app" in a postflight script because Leopard notices it's
> > > downloaded from the Internet. I'm seeing the same thing with
> > > launchctl.
> > >
> > > Anyone know a way to launch your program after the install on Leopard?
> > >
> > > Thanks very much.
> >
> > The problem is that Apple attaches to those files coming from the
> > internet an extended attribute. Run this from terminal to see it
> >
> > xattr -l myApp.app
> >
> > Once attribute is removed with
> >
> > xattr -d com.apple.quarantine myApp.app
> >
> > You can launch it without user interaction.
> >
> > Hope this helps,
> >
> > Martin
> >
> > PS.: Apple heavily uses now extended attributes for various things in
> > Leopard.
> >
>
>
>
>
> --
> http://www.littleshoot.org
> Open Source, Open Standards, Open Data
>
--
http://www.littleshoot.org
Open Source, Open Standards, Open Data
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden