Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Firefox 3.6 Advanced INF install

- - - - -

  • Please log in to reply
12 replies to this topic

#1
Acheron

Acheron

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 988 posts
  • OS:XP Pro x86
  • Country: Country Flag
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/19...rdf-syntax-ns#"
xmlns:em="http://www.mozilla.o.../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.

Edited by Acheron, 30 January 2010 - 10:19 AM.

Say no to bloatware. Download Nero Lite!


How to remove advertisement from MSFN

#2
ckislam

ckislam

    Islam Adel

  • Member
  • PipPip
  • 142 posts
  • OS:Windows 7 x64
  • Country: Country Flag

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.
Islam Adel
TGUP Posted ImagePosted Image

#3
Acheron

Acheron

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 988 posts
  • OS:XP Pro x86
  • Country: Country Flag
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.
Say no to bloatware. Download Nero Lite!

#4
ckislam

ckislam

    Islam Adel

  • Member
  • PipPip
  • 142 posts
  • OS:Windows 7 x64
  • Country: Country Flag
assuming the first id is the correct id..
i made the following script to install Firefox addons

requirements:
(put all of them in the same folder)

1. UnZip.exe (Command line extractor) from http://www.info-zip.org
or use any other you extractor you prefer and adjust the parameters for extraction below

2. youraddon.xpi (any Firefox compatible xpi)

3. This cmd script call it install.cmd for example

@echo off
Title Firefox Addon installer by TGUP.net
echo.
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))
:vaivai
IF 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 error
tskill firefox

FOR /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 >NUL
IF EXIST "%temp%\youraddon\" rd /s /q "%temp%\youraddon"
exit

:unsure:

Edited by ckislam, 02 February 2010 - 11:54 AM.

Islam Adel
TGUP Posted ImagePosted Image

#5
flabdablet

flabdablet
  • Member
  • 2 posts
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 by flabdablet, 31 January 2010 - 04:21 AM.


#6
Acheron

Acheron

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 988 posts
  • OS:XP Pro x86
  • Country: Country Flag
^ 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.
Say no to bloatware. Download Nero Lite!

#7
strel

strel

    segmentation fault

  • Member
  • PipPipPipPip
  • 629 posts
  • OS:XP Pro x86
  • Country: Country Flag
Rob van der Woude's page is a nice one.

#8
ckislam

ckislam

    Islam Adel

  • Member
  • PipPip
  • 142 posts
  • OS:Windows 7 x64
  • Country: Country Flag
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
Islam Adel
TGUP Posted ImagePosted Image

#9
titishor

titishor

    Newbie

  • Member
  • 33 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Tested . Works 100%
Firefox 3.6 silent install :
Command line : firefox3.6.exe -ms -ira

#10
oskingen

oskingen

    MSFN Friend

  • Member
  • PipPipPipPip
  • 613 posts
  • OS:none specified
  • Country: Country Flag
the link to download unzip looks broken on the website. can someone can put it avalaible for me please.

Edited by hannubys, 21 March 2010 - 08:19 PM.


#11
zeeter

zeeter
  • Member
  • 4 posts
  • OS:XP Pro x86

assuming the first id is the correct id..
i made the following script to install Firefox addons

requirements:
(put all of them in the same folder)

1. UnZip.exe (Command line extractor) from http://www.info-zip.org
or use any other you extractor you prefer and adjust the parameters for extraction below

2. youraddon.xpi (any Firefox compatible xpi)

3. This cmd script call it install.cmd for example

@echo off
Title Firefox Addon installer by TGUP.net
echo.
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))
:vaivai
IF 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 error
tskill firefox

FOR /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 >NUL
IF EXIST "%temp%\youraddon\" rd /s /q "%temp%\youraddon"
exit

:unsure:


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.3

Any ideas?

Edited by zeeter, 15 June 2010 - 03:36 PM.


#12
zeeter

zeeter
  • Member
  • 4 posts
  • OS:XP Pro x86
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.

#13
DosProbie

DosProbie

    Senior Member

  • MSFN Sponsor
  • 688 posts
  • OS:Windows 8.1 x64
  • Country: Country Flag

Donator

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 ö¿ö

Attached Files


Edited by DosProbie, 14 March 2013 - 08:04 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN