From dfour at noos.fr Tue Nov 4 07:52:15 2003 From: dfour at noos.fr (Fournier Daniel) Date: Tue Nov 4 01:57:46 2003 Subject: [Jsconsole] Re: Installing jsconsole installing on Firebird 0.7 is broken Message-ID: <3FA74C9F.2040309@noos.fr> Hi Jaap, I'd no time to check JS Console installation on the new Firebird release. Thanks to your message, it's done. There is no problem when JS Console is installed on FB 0.7 for the 1st time. However the installation can be broken when installing with a profile you used on a previous FB version. The work around: delete all "jsconsole.mozdev..." preferences in the prefs.js file of your profile (when FB is not running) or editing prefs with about:config URL. Then reinstall JS Console. Let me know if it doesn't work. Daniel From roland.mainz at informatik.med.uni-giessen.de Sun Nov 16 13:30:48 2003 From: roland.mainz at informatik.med.uni-giessen.de (Roland Mainz) Date: Sun Nov 16 07:38:41 2003 Subject: [Jsconsole] Creating sample XPI which calls a korn shell script at mozilla startup and shutdown Message-ID: <3FB76DF8.5702765C@informatik.med.uni-giessen.de> Hi! ---- This is slightly offtopic - but maybe someone here knows a way how to implement this: I am looking for a plain, simple sample XPI which does the following thing: 1. On installation time a tar.gz placed within the XPI gets unpacked in the chrome dir 2. On deinstallation time the files created with step [1] will be removed again 3. On Mozilla startup the shell script "start_my_daemon.ksh" is being called 4. On Mozilla shutdown the shell script "kill_my_daemon.ksh" is being called I did not found an example how to do these things in the past... "protozilla" is not what I am looking for, the "mplayer" and "plugger" stuff isn't matching my needs either and even the scripts in "enigmime" and "mng" aren't the stuff I am looking for... ;-( Suggestions/idas VERY welcome... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) Roland.Mainz@informatik.med.uni-giessen.de \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 2426 901568 FAX +49 2426 901569 (;O/ \/ \O;) From dfour at noos.fr Mon Nov 17 08:18:17 2003 From: dfour at noos.fr (Fournier Daniel) Date: Mon Nov 17 02:24:09 2003 Subject: [Jsconsole] Creating sample XPI which calls a korn shell script at mozilla startup and shutdown In-Reply-To: <3FB76DF8.5702765C@informatik.med.uni-giessen.de> References: <3FB76DF8.5702765C@informatik.med.uni-giessen.de> Message-ID: <3FB87639.4030406@noos.fr> Hi Roland, Well, its slightly JS Console offtopic, but I'll try to help: Mozdev is a communitity, isn't it? Unfortunatly, XPI as no uninstall method, so uninstalling your extension should be part of standalone process, however it can be implemented using a procedure similar to the one I'll describe here. For the other parts of your problem, it's rather easy, XPCOM nsIProcess is what you need. This component can be used to launch a process, as far as you know where the executable file monitoring the process is located. Mozlib, a standalone XPCOM library which is part of JS Console extension install, has a fine IO_file_processInstantiator JavaScript class you can use to launch any executable file from the local file system. To have a compressed archive untared, write a small shell script to do the job, put it in the XPI and copy it in the directory you want (chrome) using XPInstall File methods (copy). After successful install, at first launch, your extension have to untar your archive: create an IO_file_processInstantiator class instance and let it monitor the execution of your shell script. Then, use the same functionalities to monitor your kshell deamon. For instance, from JS Console extension, the kind of code you need would be: ------------------------------------ __IMPORT__("chrome://mozlib/content/lib/js/io/file/", "process_instantiator.js"); const SCRIPT = '/path/to/your/script.sh'; const SCRIPT_ARGS = ['-x -y -z']; //your script arguments const RUNNING = false; //script process is not yet running var IOProcess = new IO_file_processInstantiator(); IOProcess.set_handle(SCRIPT); IOProcess.setProcess(RUNNING, SCRIPT_ARGS); ------------------------------------ However, all this suppose that you either use a Mozlib copy (its a MPL library) and install it as part of your package, or reproduce the behaviour of the IO_file_processInstantiator class within a JavaScript code of your own (it's not very easy, so why reinvent the wheel?). IO_file_processInstantiator class is located in mozlib/content/lib/js/io/file/process_instantiator.js file. Another thing: this implementation is described as part of a Mozilla extension and when you say "On Mozilla startup/shutdown", I understand on extension startup/shutdown. There's probably a way to do it automatically on Mozilla startup/shutdown, but I'm not sure. For the XPInstall side, have a look at JS Console or Mozlib XPI (from JS Console WebCVS) and their install.js files: they use an XPI_Installer class to monitor the XPInstall methods that can be helpful. XPI files are zip files, so just download one of them and unzip it to look at the install.js file. Let me know if this answer is helpful. Cheers, Daniel