[Project_owners] First time after installing Extension

Karsten Düsterloh mnenhy at tprac.de
Fri Dec 22 05:37:24 PST 2006


Brian King aber hob zu reden an und schrieb:
> On 22/12/2006 11:21 (CET), Amin wrote:
>> any body know how to run a javascript code only one time after 
>> installing extesion ,

You can't.

>> what i must add to install.rdf ?

It's a long-standing annoyance with install.rdf that you can't run code
on install/uninstall. You could (still) use an install.js to run code on
installation, but you'd lose all install.rdf benefits like EM
integration - and you won't get uninstall code.

> Have a default preference, say "extensions.myapp.firstrun", and set it 
> to true.
> 
> Check it every time at startup. If true, execute the code, and if false 
> do not. Once your code is executed, you can set it to false yourself to 
> ensure the code is not run on subsequent startup.

That's oh so awkward, but it's the only way atm, unfortunately. :(

EM really should have at least four callbacks: before-install,
after-install, before-uninstall, after-uninstall.


Karsten
-- 
Feel free to correct my English. :)


More information about the Project_owners mailing list