1. Does the extensions.myextension.firstrun preference exist? If yes, goto 4. 
If no, goto 2.
2. Execute "run this code only at first install" code
3. Write the extensions.myextension.firstrun preference
4. Continue with other startup (non-firstrun) code.


----- Original Message ----
From: Amin <[EMAIL PROTECTED]>
To: Mozdev Project Owners List <[email protected]>
Sent: Monday, January 22, 2007 3:41:16 PM
Subject: Re: [Project_owners] how to initial some variables

i exacly men 'RUN ONLY THIS CODE AT FIRST INSTALL'

On 1/22/07, Nickolay Ponomarev <[EMAIL PROTECTED]
> wrote:On 1/21/07, Amin <[EMAIL PROTECTED]
> wrote:
> i have some variable in my extension , i want to set them first time after
> instalation
>
>     var prefs =
> Components.classes["@
mozilla.org/preferences-service;1
> "].getService(Components.interfaces.nsIPrefService).getBranch("[EMAIL 
> PROTECTED]");
>         prefs.setCharPref
(id, sData);
>
>
>
> where i must put code like this to set them only one time ?
>
Do you mean preferences? Why don't you use default preferences?

http://developer.mozilla.org/en/docs/Code_snippets:Preferences#Default_preferences

Nickolay
_______________________________________________
Project_owners mailing list

[email protected]
http://mozdev.org/mailman/listinfo/project_owners



_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners




_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to