[Project_owners] [Fwd: [Bug 188733] Need method to ensureusershave Xprt (eg an Xprt XPI)]

Roland Mainz roland.mainz at informatik.med.uni-giessen.de
Mon Nov 17 01:02:06 EST 2003


Pete Collins wrote:
> > 1. On installation time a tar.gz placed within the XPI gets unpacked in
> > the chrome dir (not *.jar, I mean *.tar.gz)
> 
> Mozilla has no facility to unpack a tarball. You need to add everything
> uncompressed inside of your XPI and then let it be zipped up as part of
> the XPI.
> 
> Mozilla can only *unzip* archives

Well, then I have a huge problem... or not. AFAIK does the unzip stuff
not restore permission flags, including the +x (executable) flag for
user, group, others, right ?

> So to do this, you need to do it all from XPInstall.
> 
> Your prezipped XPI should have a dir archive something like this:
> 
>    chrome/
>       all files you want to unpack in the Mozilla chrome dir.
> 
>    components/
>       all files you want to unpack in the Mozilla components dir.
> 
>    my_daemon
>       any new dirs you may want to create somewhere within Mozilla

What is going to copy the files in the my_daemon/ dir to the Mozilla
dirs (note that the XPI should be working for plain, unprivledged users
as well...) ... ?

> > 2. On deinstallation time the files created with step [1] will be
> > removed again
> 
> This is certainly possible, just work to do. It is on my list to create
> an easy to use uninstaller for jslib. Others have successfully
> implemented uninstalls.

Most of the XPI packages only consist of a few files... but I am talking
about ~~220 files to remove... unless there is a recursive "delete
files" function it will be quite problematic...

> > 3. On Mozilla startup the shell script "start_my_daemon.ksh" (which is
> > part of the XPI) is being called
> 
> Yes, you would need to add a js hook in your package overlay that will
> call out to say jslib "run();

That's what I tried today - but the damn hook is never called.

Can you write me a dump, simple example XPI with the following stuff:
-- snip --
install.js # installer script
installer_shell_script.sh
my_foobar_daemon/start_my_foobar_daemon.sh
my_foobar_daemon/shutdown_my_foobar_daemon.sh
<more_files_which_are _needed_to_get_this_stuff_working.xyz>
-- snip --
Tasks what the package should do:
1. "install.js" should call "installer_shell_script.sh" at installation
time
2. On mozilla startup "my_foobar_daemon/start_my_foobar_daemon.sh" gets
called (syncronous if possible)
3. On mozilla shutdown "my_foobar_daemon/shutdown_my_foobar_daemon.sh"
gets called (syncronous if possible)

Somehow - after around 40h trial-and-error hacking I still fail somehow
to get even such a simple thing working (yes, I know... shame on me...
shame...) ... ;-(

>    http://jslib.mozdev.org/libraries/io/fileutils.js.html
> 
> > 4. On Mozilla shutdown the shell script "kill_my_daemon.ksh" (which is
> > part of the XPI) is being called
> 
> kill is here:
> 
>    http://lxr.mozilla.org/seamonkey/source/xpcom/threads/nsIProcess.idl

No, no... I don't want to kill something... better name would be
"shotdown_my_daemon.ksh"... using something like SIGKILL against the
deamon may be a bad idea...

> If you bug me enough, I can add it to jslib for you. :)
> 
> Hope this helps some Roland.

Half and half... still no success this afternoon, evening and night...
it looks either the Mozilla XPI API is not able to do what I want or I
am too dumb to get it working somehow... ;-(

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) Roland.Mainz at informatik.med.uni-giessen.de
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 2426 901568 FAX +49 2426 901569
 (;O/ \/ \O;)


More information about the Project_owners mailing list