Acheron Posted January 30, 2010 Share Posted January 30, 2010 (edited) Here is an updated tutorial to install Firefox 3.6 silently using the Advanced INF installation method.The installation script is an update for the previous posted script which worked beautifully for Firefox 3.0 and 3.5.The main difference is the method used to install Addons. For security reasons Firefox 3.6 has removed the "-install-global-extension" command option to install addons silently. However you can still install addons for all computer users by extracting the xpi files manually into the extensions directory of the Mozilla Firefox program files directory.However it takes a little bit more work as you have to look up each addon to find it's unique id. This id can be found by opening the xpi as a zip file and reading the install.rdf file with a text-viewer.The Addon ID is the information inside the <em:id> section inside the main <Description about> tree. Normally this id is the first found inside the install.rdf file.For example Firebug has the following install.rdf:<?xml version="1.0"?><RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>firebug@software.joehewitt.com</em:id> <em:version>1.5.0</em:version> <em:type>2</em:type> <!-- Any suitably modern toolkit application --> <em:targetApplication> <Description> <em:id>toolkit@mozilla.org</em:id> <em:minVersion>1.9.0.11</em:minVersion> <em:maxVersion>1.9.3.*</em:maxVersion> </Description> </em:targetApplication> <!-- Firefox --> <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>3.5</em:minVersion> <em:maxVersion>3.6.*</em:maxVersion> </Description> </em:targetApplication>For extracting the xpi files during installation I use the commandline utility of 7-zip, which can be found here Enough talk, here's my update script. The settings specified in firefox.cfg will be loaded as default settings. I show you mine, but you can store any firefox setting in this file and it will be the default setting.In the script dir I have the following folders:Defaults, contains files copied to the Profile directory (bookmarks file for example is places.sqlite)Components, contains XPCOM components (xpt extension)Addons, contains addons (xpi extension)Plugins, contains any plugins (WMP firefox plugin) Install.inf[Version]Signature="$Windows NT$"[DefaultInstall]AddReg = Firefox.AddRegCopyFiles = Firefox.CopyFiles,GrePrefs.CopyFilesRunPostSetupCommands = Firefox.Install:1UpdateInis = override.ini[DestinationDirs];Firefox install dirFirefox.CopyFiles = 16422,"Mozilla Firefox"GrePrefs.CopyFiles = 16422,"Mozilla Firefox\greprefs"[Firefox.CopyFiles];General config file"firefox.cfg"[GrePrefs.CopyFiles];Enable general config file"_config.js"[Firefox.Install];Mozilla Firefox 3.6"""%01%\Firefox36%LANG_ID%.exe"" /INI=%16422%\Mozilla Firefox\override.ini";Copy default profile folder"xcopy /i /e /y ""%01%\Defaults"" ""%16422%\Mozilla Firefox\defaults\profile""";Create download folder in My documents"cmd /c md ""%16389%\Downloads""";Create default profile"""%16422%\Mozilla Firefox\Firefox.exe"" -CreateProfile default";Copy components"cmd /c copy /y ""%01%\Components"" ""%16422%\Mozilla Firefox\Components""";Copy plugins"cmd /c copy /y ""%01%\Plugins"" ""%16422%\Mozilla Firefox\Plugins""";Install addons"%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{DD43485F-44CC-4452-A6C6-69356A7E33DA}"" ""%01%\Addons\autohide-1.8.0pre-fx+sm.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\coralietab@mozdev.org"" ""%01%\Addons\coral_ie_tab-1.69.20091202-fx-win.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\dictionary-switcher@design-noir.de"" ""%01%\Addons\dictionary_switcher-1.0.1-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{D4DD63FA-01E4-46a7-B6B1-EDAB7D6AD389}"" ""%01%\Addons\download_statusbar-0.9.6.7-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\firebug@software.joehewitt.com"" ""%01%\Addons\firebug-1.5.0-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\firecookie@janodvarko.cz"" ""%01%\Addons\firecookie-1.0.2-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{19503e42-ca3c-4c27-b1e2-9cdb2170ee34}"" ""%01%\Addons\flashgot-1.2.1.10-fx+mz+sm+tb.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{DB2EA31C-58F5-48b7-8D60-CB0739257904}"" ""%01%\Addons\imagetweak-0.19-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{46868735-c3fa-47ce-8ce7-cce51a66aceb}"" ""%01%\Addons\oldbar-1.2-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\optimizegoogle@optimizegoogle.com"" ""%01%\Addons\optimizegoogle-0.77-fx+sm.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"" ""%01%\Addons\pagerankstatus-1.0-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\tineye@ideeinc.com"" ""%01%\Addons\tineye_reverse_image_search-0.7.1-fx.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\en-US@dictionaries.addons.mozilla.org"" ""%01%\Addons\united_states_english_dictionary-4.0.0-fx+tb+sm.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\{c45c406e-ab73-11d8-be73-000a95be3b12}"" ""%01%\Addons\web_developer-1.1.8-fx+sm.xpi""""%01%\7za.exe x -y -o""%16422%\Mozilla Firefox\extensions\nl-NL@dictionaries.addons.mozilla.org"" ""%01%\Addons\woordenboek_nederlands-2.2.0-fx+tb+sm.xpi""";Set Firefox as default browser"""%16422%\Mozilla Firefox\firefox.exe"" -setDefaultBrowser -silent"[Firefox.AddReg];Add Environment variable for Personal folderHKCU,"Environment","Personal",0x00020000,"%U_SHELL_FOLDERS_PERSONAL%"[override.ini]"%16422%\Mozilla Firefox\override.ini","Install",,"CloseAppNoPrompt=true""%16422%\Mozilla Firefox\override.ini","Install",,"DesktopShortcut=false""%16422%\Mozilla Firefox\override.ini","XRE",,"EnableProfileMigrator=false"[Strings]U_SHELL_FOLDERS_PERSONAL="%USERPROFILE%\My Documents"[Strings.0413]LANG_ID="nl"U_SHELL_FOLDERS_PERSONAL="%USERPROFILE%\Mijn documenten"_config.jspref("general.config.obscure_value", 0);pref("general.config.filename", "firefox.cfg");firefox.cfg//general settingsdefaultPref("general.smoothScroll", true);defaultPref("general.warnOnAboutConfig", false);//set default download directoryvar download_dir = getenv("PERSONAL") + "\\Downloads";defaultPref("browser.download.defaultFolder", download_dir);defaultPref("browser.download.dir", download_dir);defaultPref("browser.download.downloadDir", download_dir);defaultPref("browser.download.folderList", 2);//insert new tabs at enddefaultPref("browser.tabs.insertRelatedAfterCurrent", false);//hide welcome messagesdefaultPref("browser.startup.homepage_override.mstone", "rv:1.9.2");defaultPref("browser.rights.3.shown", true);//coral ietabdefaultPref("coral.ietab.showprompt", false);//optimizegoogledefaultPref("extensions.optimizegoogle.cookies.enableDefaultPreferences", true);defaultPref("extensions.optimizegoogle.cookies.ResultsPerPage", 50);defaultPref("extensions.optimizegoogle.images.auto-page", true);defaultPref("extensions.optimizegoogle.images.image-links", true);defaultPref("extensions.optimizegoogle.images.rewrite-links", true);defaultPref("extensions.optimizegoogle.web.auto-page", true);defaultPref("extensions.optimizegoogle.web.counter", true);defaultPref("extensions.optimizegoogle.web.favicons", true);defaultPref("extensions.optimizegoogle.web.history", true);defaultPref("extensions.optimizegoogle.web.movie-links", true);defaultPref("extensions.optimizegoogle.web.news-links", true);defaultPref("extensions.optimizegoogle.web.product-links", true);defaultPref("extensions.optimizegoogle.web.search-links", true);defaultPref("extensions.optimizegoogle.web.suggest", true);defaultPref("extensions.optimizegoogle.web.weather-links", true);//download statusbardefaultPref("browser.download.manager.alertOnEXEOpen", false);defaultPref("browser.download.manager.showAlertOnComplete", false);defaultPref("browser.download.manager.showWhenStarting", false);defaultPref("downbar.function.firstRun", false);defaultPref("downbar.function.version", "0.9.6.7");//flashgotdefaultPref("flashgot.firstRunRedirection", false);Defaults\prefs.jsuser_pref("browser.startup.homepage", "http://www.google.com");user_pref("browser.search.selectedEngine", "Wikipedia (Eng)");Using Windows XP you can launch the Firefox setup during T13 using cmdlines.txt in the $OEM$ directory.I have placed Firefox setup files into $OEM$\Install\Mozilla Firefox directory so to install Firefox using the AdvancedINF command I would add the following line to cmdlines.txt:"rundll32.exe advpack.dll,LaunchINFSection .\Install\Mozilla Firefox\install.inf,,1"Current limitations:- Desktop shortcut setting in override.ini is ignored, so a desktop shortcut is created anyway.- Some settings are overridden when user accounts are created. Setting the homepage and search engine can only from the prefs.js file.- AdvancedINF method needs Administrator privileges on Windows Vista and newer. However I currently have no interest in switching to Windows 7 yet so I haven't worked on a solution. Edited January 30, 2010 by Acheron Link to comment Share on other sites More sharing options...
ckislam Posted January 30, 2010 Share Posted January 30, 2010 inside the main <Description about> tree. Normally this id is the first found inside the install.rdf file.did you face any case where the id was NOT the first one?(that would help me a lot in creating a global installer for all addons)thanks a lot. Link to comment Share on other sites More sharing options...
Acheron Posted January 30, 2010 Author Share Posted January 30, 2010 Most rdf files have similar layouts. However as the xml specification doesn't specify anything about tag order I can't guarantee the id tag will come first. Link to comment Share on other sites More sharing options...
ckislam Posted January 30, 2010 Share Posted January 30, 2010 (edited) assuming the first id is the correct id..i made the following script to install Firefox addonsrequirements:(put all of them in the same folder)1. UnZip.exe (Command line extractor) from http://www.info-zip.orgor use any other you extractor you prefer and adjust the parameters for extraction below2. youraddon.xpi (any Firefox compatible xpi)3. This cmd script call it install.cmd for example@echo offTitle Firefox Addon installer by TGUP.netecho.Echo Installing youraddon..IF EXIST "%temp%\youraddon\" rd /s /q "%temp%\youraddon"MD "%temp%\youraddon\addon"Start /B /Wait "Extracting" "UnZip.exe" -q -o "youraddon.xpi" -d "%temp%\youraddon\addon"FOR /F "tokens=2,3 delims=^<^>=" %%i in ('FIND "em:id" "%temp%\youraddon\addon\install.rdf"') DO (IF "%%~j"=="" (SET xpi_id=%%~i&GOTO :vaivai) ELSE (SET xpi_id=%%~j&GOTO :vaivai)):vaivaiIF NOT DEFINED xpi_id ( ECHO. ECHO. Echo Error occured while extracting.. ping.exe 127.0.0.1 -n 4 >NUL EXIT)rem kill firefox or get write errortskill firefoxFOR /F %%a in ('dir /ad /b "%appdata%\Mozilla\Firefox\Profiles\*.default"') DO (IF EXIST "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%\" rd /s /q "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%"IF NOT EXIST "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%\" MD "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%"FOR /F "tokens=*" %%i in ('dir /b /og "%temp%\youraddon\%xpi_id%\"') DO MOVE /Y "%temp%\youraddon\%xpi_id%\%%i" "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%\")echo.echo Installation Done!ping.exe 127.0.0.1 -n 4 >NULIF EXIST "%temp%\youraddon\" rd /s /q "%temp%\youraddon"exit Edited February 2, 2010 by ckislam Link to comment Share on other sites More sharing options...
flabdablet Posted January 31, 2010 Share Posted January 31, 2010 (edited) Looks like we've been working along similar lines.I like your ^<^> trick for persuading cmd not to treat angle brackets as redirects. Where is that documented? Wherever it is, I am sure to find more tips that will save me time when I next wrestle with cmd's almost-a-parser. Edited January 31, 2010 by flabdablet Link to comment Share on other sites More sharing options...
Acheron Posted January 31, 2010 Author Share Posted January 31, 2010 ^ is the escape character in batch scripts. It means the following command character will be treated as a normal character. In INF scripts you have no escape character but you must double them instead. That's why you see "" in stead of a single " for commands. Link to comment Share on other sites More sharing options...
strel Posted January 31, 2010 Share Posted January 31, 2010 Rob van der Woude's page is a nice one. Link to comment Share on other sites More sharing options...
ckislam Posted February 2, 2010 Share Posted February 2, 2010 I found some different formatting in some XPIs<em:id>{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}</em:id>em:id="bettergmail2@ginatrapani.org"I updated the script above to handle both cases correctly Link to comment Share on other sites More sharing options...
titishor Posted February 3, 2010 Share Posted February 3, 2010 Tested . Works 100% Firefox 3.6 silent install : Command line : firefox3.6.exe -ms -ira Link to comment Share on other sites More sharing options...
oskingen Posted March 22, 2010 Share Posted March 22, 2010 (edited) the link to download unzip looks broken on the website. can someone can put it avalaible for me please. Edited March 22, 2010 by hannubys Link to comment Share on other sites More sharing options...
zeeter Posted June 15, 2010 Share Posted June 15, 2010 (edited) assuming the first id is the correct id..i made the following script to install Firefox addonsrequirements:(put all of them in the same folder)1. UnZip.exe (Command line extractor) from http://www.info-zip.orgor use any other you extractor you prefer and adjust the parameters for extraction below2. youraddon.xpi (any Firefox compatible xpi)3. This cmd script call it install.cmd for example@echo offTitle Firefox Addon installer by TGUP.netecho.Echo Installing youraddon..IF EXIST "%temp%\youraddon\" rd /s /q "%temp%\youraddon"MD "%temp%\youraddon\addon"Start /B /Wait "Extracting" "UnZip.exe" -q -o "youraddon.xpi" -d "%temp%\youraddon\addon"FOR /F "tokens=2,3 delims=^<^>=" %%i in ('FIND "em:id" "%temp%\youraddon\addon\install.rdf"') DO (IF "%%~j"=="" (SET xpi_id=%%~i&GOTO :vaivai) ELSE (SET xpi_id=%%~j&GOTO :vaivai)):vaivaiIF NOT DEFINED xpi_id ( ECHO. ECHO. Echo Error occured while extracting.. ping.exe 127.0.0.1 -n 4 >NUL EXIT)rem kill firefox or get write errortskill firefoxFOR /F %%a in ('dir /ad /b "%appdata%\Mozilla\Firefox\Profiles\*.default"') DO (IF EXIST "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%\" rd /s /q "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%"IF NOT EXIST "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%\" MD "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%"FOR /F "tokens=*" %%i in ('dir /b /og "%temp%\youraddon\%xpi_id%\"') DO MOVE /Y "%temp%\youraddon\%xpi_id%\%%i" "%appdata%\Mozilla\Firefox\Profiles\%%a\extensions\%xpi_id%\")echo.echo Installation Done!ping.exe 127.0.0.1 -n 4 >NULIF EXIST "%temp%\youraddon\" rd /s /q "%temp%\youraddon"exit Just tried this and it's not working for me. The prompt flashes and then quickly closes. I closed firefox before running this. I name the files what you have here and put them all in the same directory. Using this on firefox 3.6.3Any ideas? Edited June 15, 2010 by zeeter Link to comment Share on other sites More sharing options...
zeeter Posted June 16, 2010 Share Posted June 16, 2010 I think I was able to create a silent installer after examining one of yours ckislam and using CreateurSFXv2 So I should be ok for now.Thanks for the good info and script. Link to comment Share on other sites More sharing options...
DosProbie Posted October 27, 2012 Share Posted October 27, 2012 (edited) Here is a undated Addon Installer to Install Multiple Firefox Addon's .. Tested and Working 100% on Windows Vista, Win 7 and Win 8 32-64bit.also has optional installer for your user.js file as well. Say Thanks if you find this useful... DosProbile ö¿öMulti-AO.Installer.cmd Edited March 14, 2013 by DosProbie Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now