What is the andvantages
* No dependence of where firefox is installed
* Flexible for update,just update extension or theme setup file
* One default file for every profile
* Automatic random name for profiles just like original firefox
Bugs:
Adblock doesnt install by commandline.Bugfree version is here
I used some of codes from simonsays'.Here is what I do.
1) Create Directory lets say C:\Work and unpack Firefox setup files to that directory.
2) Inside this directory create Directory named "Setup"
3) In this "Setup" directory directory create below directories
Plugins
Profile
XPI
searchplugins
JAR
4) Install firefox,extensions and themes and tweak it the way you want.Go to
%APPDATA%\Mozilla\Firefox\Profiles\random.default\
copy prefs.js and bookmarks.html to C:\Work\Setup\Profile
5) Put your extensions' setup file(files end with .xpi) to C:\Work\Setup\XPI
6) Put your themes' setup file(files end with .jar) to C:\Work\Setup\JAR
7) Put your plugins(%PROGRAMFILES%Mozilla Firefox\plugins\*.*) to C:\Work\Setup\Plugins
8) Put your search plugins(%PROGRAMFILES%Mozilla Firefox\searchplugins\*.*) to C:\Work\Setup\searchplugins
9) Create setup.cmd file inside C:\Work\Setup with belowed content
CODE
@echo off
cmdow @ /HID
SET pfname="%APPDATA%\Mozilla\Firefox\Profiles.ini"
FOR %%A IN ("%PROGRAMFILES%") DO SET SHORTPF=%%~sA
"%SYSTEMDRIVE%\Install\Firefox\setup.exe" -ms
REM there is a limit in tokens.Token bigger than 31 is ignored.So only lower ascii numbers will be used
REM Create random directory name for new profile
:MP
set a=0
set mypath=
:LP
if %a%==8 GOTO :NEXT
SET /A i=(%RANDOM% %%% 26)+1
FOR /F "tokens=%i%" %%j IN ("a b c d e f g h i j k l m n o p q r s t u v w x y z") do set mypath=%mypath%%%j
SET /A a+=1
GOTO :LP
:NEXT
IF EXIST "%APPDATA%\Mozilla\Firefox\Profiles\%mypath%.default\*.*" GOTO :MP
REM Create directory
md "%APPDATA%\Mozilla\Firefox\Profiles\%mypath%.default\
XCOPY /Y /E /Q /H /R "%SYSTEMDRIVE%\Install\Firefox\Setup\Profile" "%APPDATA%\Mozilla\Firefox\Profiles\%mypath%.default"
REM CREATE profiles.ini
echo.
echo [General]>>%pfname%
echo StartWithLastProfile=^1>>%pfname%
echo.>> %pfname%
echo [Profile0]>>%pfname%
echo Name=default>>%pfname%
echo IsRelative=^1>>%pfname%
echo Path=Profiles/%mypath%.default>>%pfname%
echo.>> %pfname%
REM Extensions and Themes Setup
REM each for command is on one line no line break
for %%e in ("%SYSTEMDRIVE%\Install\Firefox\Setup\XPI\*.xpi") do start /wait %SHORTPF%\MOZILL~1\FIREFOX.EXE -install-global-extension "%%e"
for %%e in ("%SYSTEMDRIVE%\Install\Firefox\Setup\JAR\*.jar") do start /wait %SHORTPF%\MOZILL~1\FIREFOX.EXE -install-global-theme "%%e"
REM Plugins and Searchplugins Setup
XCOPY /Y /E /Q /H /R "%SYSTEMDRIVE%\Install\Firefox\Setup\plugins" "%SHORTPF%\MOZILL~1\plugins"
XCOPY /Y /E /Q /H /R "%SYSTEMDRIVE%\Install\Firefox\Setup\searchplugins" "%SHORTPF%\MOZILL~1\searchplugins"
EXIT
cmdow @ /HID
SET pfname="%APPDATA%\Mozilla\Firefox\Profiles.ini"
FOR %%A IN ("%PROGRAMFILES%") DO SET SHORTPF=%%~sA
"%SYSTEMDRIVE%\Install\Firefox\setup.exe" -ms
REM there is a limit in tokens.Token bigger than 31 is ignored.So only lower ascii numbers will be used
REM Create random directory name for new profile
:MP
set a=0
set mypath=
:LP
if %a%==8 GOTO :NEXT
SET /A i=(%RANDOM% %%% 26)+1
FOR /F "tokens=%i%" %%j IN ("a b c d e f g h i j k l m n o p q r s t u v w x y z") do set mypath=%mypath%%%j
SET /A a+=1
GOTO :LP
:NEXT
IF EXIST "%APPDATA%\Mozilla\Firefox\Profiles\%mypath%.default\*.*" GOTO :MP
REM Create directory
md "%APPDATA%\Mozilla\Firefox\Profiles\%mypath%.default\
XCOPY /Y /E /Q /H /R "%SYSTEMDRIVE%\Install\Firefox\Setup\Profile" "%APPDATA%\Mozilla\Firefox\Profiles\%mypath%.default"
REM CREATE profiles.ini
echo.
echo [General]>>%pfname%
echo StartWithLastProfile=^1>>%pfname%
echo.>> %pfname%
echo [Profile0]>>%pfname%
echo Name=default>>%pfname%
echo IsRelative=^1>>%pfname%
echo Path=Profiles/%mypath%.default>>%pfname%
echo.>> %pfname%
REM Extensions and Themes Setup
REM each for command is on one line no line break
for %%e in ("%SYSTEMDRIVE%\Install\Firefox\Setup\XPI\*.xpi") do start /wait %SHORTPF%\MOZILL~1\FIREFOX.EXE -install-global-extension "%%e"
for %%e in ("%SYSTEMDRIVE%\Install\Firefox\Setup\JAR\*.jar") do start /wait %SHORTPF%\MOZILL~1\FIREFOX.EXE -install-global-theme "%%e"
REM Plugins and Searchplugins Setup
XCOPY /Y /E /Q /H /R "%SYSTEMDRIVE%\Install\Firefox\Setup\plugins" "%SHORTPF%\MOZILL~1\plugins"
XCOPY /Y /E /Q /H /R "%SYSTEMDRIVE%\Install\Firefox\Setup\searchplugins" "%SHORTPF%\MOZILL~1\searchplugins"
EXIT
