Archive: Modifying firefox preferences


Modifying firefox preferences
Hi all I am looking for a way to change the prefs.js for firefox.

The problem is, depending on if its XP or vista the profiles directory is stored differently.

XP: AppData -> Mozilla
vista/7: AppData -> Roaming -> Mozilla

also under the "profiles" directory, there is another folder named differently on every computer (mine is ugj55fv1.default). Then below that is the prefs.js which I want to modify.

Any ideas?

Thanks,
Jordan


Use the logiclib macros in winver.nsh to distinguish between different OS versions. Use FindFirst/FindNext to enumerate all subfolders.


Use $APPDATA. $APPDATA\Mozilla

And the profile name is stored in an ini file you can probably do this:


Var /global MOZ_PREFJS_PATH

ReadINIStr $R0 $APPDATA\Mozilla\Firefox\profiles.ini Profile0 Path
;$R0 = Profiles\something.default

StrCpy $MOZ_PREFJS_PATH "$APPDATA\Mozilla\Firefox\$R0\prefs.js"

does the $APPDATA work on vista/7 though since there are sub folders between that and Mozilla (Roaming, local, etc.)?


Yes, $APPDATA will work on NT6 (MS changed the path, but NSIS uses the documented shell API's to get the path)