Firefox 52.3.0 esr mit Addons installieren

Antworten
phorms
Beiträge: 4
Registriert: 17 Nov 2015, 10:45

Firefox 52.3.0 esr mit Addons installieren

Beitrag von phorms »

Hallo,

ich möchte für unsere User Firefox mit vordefinierten Addons installieren. Den Browser mit vordefenierten Einstellungen (mit Hilfe von einer .js und einer .cfg Datei) verteilen wir schon länger ohne Probleme, aber die Addons bereiten Probleme.

Das Ziel ist, sowohl bei bestehenden Usern, als auch bei neuen, einen Set an Addons vor zu installieren. Dabei sollten die Nutzer in der Lage sein eigene Addons zu installieren bzw. deinstallieren. Ich habe bereits viele verschiedene Wege, die auf der Mozilla dev Seite und den Seiten des Herrn Kaply ausprobiert. Bislang hat nicht funktioniert. Die Letzte Vorgehensweise:

- Die .xpi Dateien in einen Ordner mit der ID des Addons entpackt
- Diese Ordner nach %ProgramFiles32Dir%\Mozilla Firefox\browser\extensions\ kopiert
- Die .xpi Dateien nach %ProgramFiles32Dir%\Mozilla Firefox\extensions\ kopiert
- extensions.autoDisableScopes wurde bereits auf 0 in einer .cfg gesetzt

Diese Operationen sollten eigentlich reichen, damit die Addons installiert werden, jedoch werden diese nicht übernommen. Hier ist der Setup-Skript:

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.11"
ScriptErrorMessages = false

DefVar $ProductName$
DefVar $ProductId$
DefVar $Setupfile$ 
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $ErrorMsg$
DefVar $LogDir$

Set $LogDir$          = "%opsiLogDir%"
Set $ProductName$     = "Mozilla Firefox ESR"
Set $ProductId$       = "office_mozilla_firefox"
Set $Setupfile$       = "FirefoxSetup52.3.0.exe"
Set $MinimumSpace$    = "290 MB"

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
   LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductName$
   isFatalError "No Space"
else
   comment "Show product picture"
   ShowBitmap "%ScriptPath%\" + "logo.png"

   if FileExists("%ScriptPath%\delsub.opsiscript")
      comment "Start uninstall sub section"
      Sub "%ScriptPath%\delsub.opsiscript"
   endif
   
   Message "Installing " + $ProductName$ + " ..."
   comment "Start setup program"
   ChangeDirectory "%SCRIPTPATH%"
   Winbatch_install
   Files_install
   Sub_check_exitcode	
endif

[Winbatch_install]
"%ScriptPath%\FirefoxSetup52.3.0.exe" /S 


[Files_install]	
	;	-> installiere die Konfiguration
	copy -s "%ScriptPath%\Extensions\autoconfig.js" "%ProgramFiles32Dir%\Mozilla Firefox\defaults\pref\"
	copy -s "%ScriptPath%\Extensions\phorms_mozilla.cfg" "%ProgramFiles32Dir%\Mozilla Firefox\"
	
	;	-> installiere die Addons
	;	-> Smart HTTPS	
	copy -s "%ScriptPath%\files\extensions\{b3e677f4-1150-4387-8629-da738260a48e}.xpi" "%ProgramFiles32Dir%\Mozilla Firefox\extensions\"
	copy -s "%ScriptPath%\files\extensions\{b3e677f4-1150-4387-8629-da738260a48e}\*" "%ProgramFiles32Dir%\Mozilla Firefox\browser\extensions\{b3e677f4-1150-4387-8629-da738260a48e}"
	;	-> uBlock Origin
	copy -s "%ScriptPath%\files\extensions\uBlock0@raymondhill.net.xpi" "%ProgramFiles32Dir%\Mozilla Firefox\extensions\"
	copy -s "%ScriptPath%\files\extensions\uBlock0@raymondhill.net\*" "%ProgramFiles32Dir%\Mozilla Firefox\browser\extensions\uBlock0@raymondhill.net"
	;	-> GPO
	copy -s "%ScriptPath%\files\extensions\gpo@extensions.org.xpi" "%ProgramFiles32Dir%\Mozilla Firefox\extensions\"
	copy -s "%ScriptPath%\files\extensions\gpo@extensions.org\*" "%ProgramFiles32Dir%\Mozilla Firefox\browser\extensions\uBlock0@raymondhill.net"
	;	-> Phorms CCK2
	copy -s "%ScriptPath%\files\extensions\customercare@phorms.de.xpi" "%ProgramFiles32Dir%\Mozilla Firefox\extensions\"
	copy -s "%ScriptPath%\files\extensions\customercare@phorms.de\*" "%ProgramFiles32Dir%\Mozilla Firefox\browser\extensions\uBlock0@raymondhill.net"	
	

[sub_check_exitcode]
comment "test for installation success via exit code"
set $ExitCode$ = getLastExitCode
if ($ExitCode$ = "0")
        comment "looks good: setup program gives exitcode zero"
else
        comment "Setup program gives a exitcode unequal zero: "+$ExitCode$
        if ($ExitCode$ = "1605")
                comment "ERROR_UNKNOWN_PRODUCT  1605    This action is only valid for products that are currently installed."
                comment "Uninstall of a not installed product failed - no problem"
        else
                if ($ExitCode$ = "1641")
                        comment "looks good: setup program gives exitcode 1641"
                        comment "ERROR_SUCCESS_REBOOT_INITIATED 1641    The installer has initiated a restart. This message is indicative of a success."
                else
                        if ($ExitCode$ = "3010")
                                comment "looks good: setup program gives exitcode 3010"
                                comment "ERROR_SUCCESS_REBOOT_REQUIRED  3010    A restart is required to complete the install. This message is indicative of a success."
                        else
                                logError "Fatal: Setup program gives an unknown exitcode unequal zero: "+$ExitCode$
                                isFatalError
                        endif
                endif
        endif
endif
Laut Log gibt es noch Kopiervorgänge, die ich nicht ganz zuordnen kann:

Code: Alles auswählen

6] [Aug 17 16:14:47:460]     Copying  C:\Users\user.ordner\Desktop\office_mozilla_firefox_se\CLIENT_DATA\files\extensions\customercare@phorms.de.xpi -----> C:\Program Files (x86)\Mozilla Firefox\extensions\
[5] [Aug 17 16:14:47:462]       1 File(s) found
[6] [Aug 17 16:14:47:466]       Source C:\Users\user.ordner\Desktop\office_mozilla_firefox_se\CLIENT_DATA\files\extensions\customercare@phorms.de.xpi
[6] [Aug 17 16:14:47:472]         C:\Users\user.ordner\Desktop\office_mozilla_firefox_se\CLIENT_DATA\files\extensions\customercare@phorms.de.xpi copied to C:\Program Files (x86)\Mozilla Firefox\extensions\
[6] [Aug 17 16:14:47:475]       No (non-directory) file with mask  C:\Users\user.ordner\Desktop\office_mozilla_firefox_se\CLIENT_DATA\files\extensions\customercare@phorms.de\customercare@phorms.de.xpi  found
[6] [Aug 17 16:14:47:478]       No (non-directory) file with mask  C:\Users\user.ordner\Desktop\office_mozilla_firefox_se\CLIENT_DATA\files\extensions\customercare@phorms.de\cck2\customercare@phorms.de.xpi  found
Die Datei wird richtig kopiert, danach der Inhalt noch mal in einen Ordner "entpackt" unter %ProgramFiles32Dir%\Mozilla Firefox\extensions\ kopiert.

Ich nehme an, es haben viele bereits Firefox mit Addons paketiert und verteilt. Kann ja nicht so schwer sein :oops:
Kann mir einer da weiterhelfen?

Viele Grüße
Phorms
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: Firefox 52.3.0 esr mit Addons installieren

Beitrag von SisterOfMercy »

I have these options set in the autoconfig file:

Code: Alles auswählen

pref("extensions.enabledScopes", 15);
pref("extensions.autoDisableScopes", 0);
pref("extensions.shownSelectionUI", true);
I have a script that at least deploys add-ons, but the user has to enable them themselves. Haven't figured this step out yet, because there are multiple ways, and because of those bootstrap extensions.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
weener
Beiträge: 8
Registriert: 02 Aug 2017, 17:54

Re: Firefox 52.3.0 esr mit Addons installieren

Beitrag von weener »

Bei uns wird (in einem Extra-Paket) das Add-On "AdBlockPlus" installiert. Dazu wird lediglich die XPI-Datei in "distribution\extensions" kopiert:

Code: Alles auswählen

[Files_install]
copy "%ScriptPath%\files\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi" "$InstallDir$\distribution\extensions\"
Schönen Gruß,
Michael
phorms
Beiträge: 4
Registriert: 17 Nov 2015, 10:45

Re: Firefox 52.3.0 esr mit Addons installieren

Beitrag von phorms »

@Michael
Hallo,

vielen Dank, das hat super funktioniert :)

Viele Grüße
Phorms

@ SisterOfMercy
Hello,

these config line were already included in my config file, thank you :) Look into the code of weener (Michael), works like a charm for deploying and installing Addons on start without user interaction.

Greetings
Phorms
Antworten