jordanstreet
4th August 2010 19:40 UTC
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
MSG
4th August 2010 20:05 UTC
Use the logiclib macros in winver.nsh to distinguish between different OS versions. Use FindFirst/FindNext to enumerate all subfolders.
redxii
4th August 2010 21:01 UTC
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"
jordanstreet
5th August 2010 18:21 UTC
does the $APPDATA work on vista/7 though since there are sub folders between that and Mozilla (Roaming, local, etc.)?
Anders
5th August 2010 18:49 UTC
Yes, $APPDATA will work on NT6 (MS changed the path, but NSIS uses the documented shell API's to get the path)