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:
Quote
<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.AddReg
CopyFiles = Firefox.CopyFiles,GrePrefs.CopyFiles
RunPostSetupCommands = Firefox.Install:1
UpdateInis = override.ini
[DestinationDirs]
;Firefox install dir
Firefox.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 folder
HKCU,"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.js
pref("general.config.obscure_value", 0);
pref("general.config.filename", "firefox.cfg");
firefox.cfg
//general settings
defaultPref("general.smoothScroll", true);
defaultPref("general.warnOnAboutConfig", false);
//set default download directory
var 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 end
defaultPref("browser.tabs.insertRelatedAfterCurrent", false);
//hide welcome messages
defaultPref("browser.startup.homepage_override.mstone", "rv:1.9.2");
defaultPref("browser.rights.3.shown", true);
//coral ietab
defaultPref("coral.ietab.showprompt", false);
//optimizegoogle
defaultPref("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 statusbar
defaultPref("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");
//flashgot
defaultPref("flashgot.firstRunRedirection", false);
Defaults\prefs.js
user_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.
This post has been edited by Acheron: 30 January 2010 - 10:19 AM



Help

Back to top











