[gelöst] Firefox Paket Dateien in Verzeichnis kopieren

Antworten
rbroda
Beiträge: 23
Registriert: 24 Jul 2017, 15:26

[gelöst] Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von rbroda »

Hab folgenden OPSI Script für den Firefox erstellt:

Code: Alles auswählen

; ----------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; ----------------------------------------------------------------

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

DefVar $ProductId$
DefVar $InstallDir$
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $ErrorString$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $LogDir$
DefVar $OS$
DefVar $oldProgFound$


Set $LogDir$ = "%opsiLogDir%"

; import complete file !
importlib "uib_exitcode.opsiscript"
importlib "%scriptpath%\osd-lib.opsiscript"


; ----------------------------------------------------------------
; $ProductId$ is the name of the product in opsi, only lower letters, no umlauts, no white spaces, use '-' as a seperator
Set $ProductId$		= "firefox"
; the path where we find the product after the installation
Set $InstallDir$	= "%ProgramFiles%\Mozilla Firefox"
Set $LicenseRequired$ = "False"
Set $LicensePool$	  = "" 
Set $MinimumSpace$	 = "279 MB"
; ----------------------------------------------------------------

set $OS$ = GetOS

if not(($OS$ = "Windows_NT"))
	logError "Installation aborted: wrong OS version: only Windows"
	isFatalError "wrong OS"
endif

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError "No Space"
	; Stop process and set installation status to failed
endif

comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$



if FileExists("%ScriptPath%\delsub.opsiscript")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub.opsiscript"
endif

Message "Installing " + $ProductId$ + " ..."

if $LicenseRequired$ = "true"
	comment "Licensing required, reserve license and get license key"
	set $LicenseKey$ = get_licensekey_byPoolOrKey($LicensePool$)
endif


comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%\files"
;----------------------------------------------
Winbatch_install

;----------------------------------------------
Sub_check_exitcode
Files_install



[Winbatch_install]
"%scriptpath%\files\setup.exe" -ms

[Files_install]
copy -s "%scriptpath%\files\override.ini" "$InstallDir$\browser\."
copy -s "%scriptpath%\files\mozilla.cfg" "$InstallDir$\."
copy -s "%scriptpath%\files\autoconfig.js" "$InstallDir$\defaults\pref\."
copy -s "%scriptpath%\files\extensions" "$InstallDir$\browser\."





[sub_check_exitcode]
set $ExitCode$ = getlastexitcode
if stringtobool(isMsExitcodeFatal_short($exitcode$, "true", $ErrorString$ ))
	LogError $ErrorString$
	isfatalerror $ErrorString$
else
	Comment $ErrorString$
endif


; ----------------------------------------------------------------
; ----------------------------------------------------------------

Ich möchte folgende Dateien nach der Installation von Firefox nach "C:\Program Files\Mozilla Firefox" kopieren:
- override.ini
- mozilla.cfg
- autoconfig.js
- extensions (Verzeichnis)

Dachte, ich habe es im Script richtig...
Bekomme folgede Error im Log nach der Installation:

Code: Alles auswählen

[6] [Dez 11 15:50:59:879] [firefox] ~~~~~~~ End Sub   ~~~~~~~  Sub_check_exitcode
[6] [Dez 11 15:50:59:879] [firefox] 
[5] [Dez 11 15:50:59:879] [firefox] Execution of: Files_install
[5] [Dez 11 15:50:59:879] [firefox] 
[3] [Dez 11 15:50:59:882] [firefox]   Error:  Directory p:\firefox\files\%ProgramFiles%\Mozilla Firefox\browser does not exist and cannot be created
[3] [Dez 11 15:50:59:883] [firefox]   Error:  Directory p:\firefox\files\%ProgramFiles%\Mozilla Firefox does not exist and cannot be created
[3] [Dez 11 15:50:59:885] [firefox]   Error:  Directory p:\firefox\files\%ProgramFiles%\Mozilla Firefox\defaults\pref does not exist and cannot be created
[3] [Dez 11 15:50:59:887] [firefox]   Error:  Directory p:\firefox\files\%ProgramFiles%\Mozilla Firefox\browser does not exist and cannot be created
[1] [Dez 11 15:50:59:887] [firefox] ___________________
[1] [Dez 11 15:50:59:887] [firefox] script finished: success
[1] [Dez 11 15:50:59:887] [firefox] 4 errors
[1] [Dez 11 15:50:59:887] [firefox] 0 warnings
Ich verzweifele... Was mache ich falsch???
Zuletzt geändert von rbroda am 12 Dez 2019, 08:59, insgesamt 1-mal geändert.
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von SisterOfMercy »

rbroda hat geschrieben:Ich verzweifele... Was mache ich falsch???
I think 32 and 64-bit things.

setup3264.opsiscript:

Code: Alles auswählen

[Actions]
;SetLogLevel=9
;requiredWinstVersion >= "4.12.0.27"

;DefVar $MsiId32$
;DefVar $UninstallProgram32$
;DefVar $MsiId64$
;DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $INST_SystemType$
;DefVar $INST_architecture$
DefVar $INST_MsVersion$

DefStringList $ProductInfo$
DefVar $DisplayVersion$
DefVar $DisplayName$
set $ProductInfo$ = getProductMap
set $DisplayVersion$ = getValue("productversion", $ProductInfo$)
set $DisplayName$ = getValue("name", $ProductInfo$)

set $INST_MsVersion$ = GetMsVersionInfo
Set $INST_SystemType$ = GetSystemType
;set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"

; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, 
; no white space use '-' as a seperator
Set $ProductId$       = "mozilla-firefox"
Set $MinimumSpace$    = "1500 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "%ProgramFiles32Dir%\Mozilla Firefox"
Set $InstallDir64$      = "%ProgramFiles64Dir%\Mozilla Firefox"
; ----------------------------------------------------------------

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
endif
if CompareDotSeparatedNumbers($INST_MsVersion$, "<", "5.1")
	LogError "Windows XP or newer is required for " + $ProductId$  
	isFatalError
endif

comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$

if FileExists("%ScriptPath%\delsub3264.opsiscript")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub3264.opsiscript"
endif
	
comment "installing"

if ($INST_SystemType$ = "x86 System") or (CompareDotSeparatedNumbers($INST_MsVersion$, "<", "6"))
	Message "Installing " + $ProductId$ + "..."
	comment "Start setup program"
	Files_install_32 /32Bit
	comment "Patch Registry"
	Registry_install_32 /32Bit
	Registry_install_AllProfiles /AllNTUserDats
	comment "Create shortcuts"
	LinkFolder_install_32
	comment "Copy files"
	Files_install_AllProfiles /AllNtUserProfiles
endif

if ($INST_SystemType$ = "64 Bit System") and (CompareDotSeparatedNumbers($INST_MsVersion$, ">=", "6"))
	Message "Installing " + $ProductId$ + "..."
	comment "Copy files"
	Files_install_64 /64Bit
	comment "Patch Registry"
	Registry_install_64 /64Bit
	Registry_install_AllProfiles /AllNTUserDats
	comment "Create shortcuts"
	LinkFolder_install_64
	comment "Copy files"
	Files_install_AllProfiles /AllNtUserProfiles
endif

if (CompareDotSeparatedNumbers($INST_MsVersion$, "=", "10.0"))
	Registry_install_AllProfiles_win10 /AllNTUserDats
endif

[Files_install_32]
copy -s "%ScriptPath%\files\x86\*" "$InstallDir32$"

[Files_install_64]
copy -s "%ScriptPath%\files\x64\*" "$InstallDir64$"

[Files_install_AllProfiles]
; copy icon to quick launch dir.
copy "%CommonDesktopDir%\Mozilla Firefox.lnk" "%UserProfileDir%\Application Data\Microsoft\Internet Explorer\Quick Launch"

[Registry_install_32]
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.htm]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.html]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.shtml]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.xht]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.xhtml]
set "" = "FirefoxHTML-308046B0AF4A39CB"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB]
set "" = "Firefox HTML Document"
set "FriendlyTypeName" = "Firefox HTML Document"
set "EditFlags" = REG_DWORD:00000002
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\DefaultIcon]
set "" = '"$InstallDir32$\firefox.exe",1'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\shell]
set "" = "open"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\shell\open\command]
set "" = '"$InstallDir32$\firefox.exe" -osint -url "%1"'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\shell\open\ddeexec]
set "" = ""

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB]
set "" = "Firefox URL"
set "FriendlyTypeName" = "Firefox URL"
set "URL Protocol" = ""
set "EditFlags" = REG_DWORD:00000002
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\DefaultIcon]
set "" = '"$InstallDir32$\firefox.exe",1'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell]
set "" = "open"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell\open\command]
set "" = '"$InstallDir32$\firefox.exe" -osint -url "%1"'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell\open\ddeexec]
set "" = ""

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet]
set "" = "Firefox-308046B0AF4A39CB"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB]
set "" = "Mozilla Firefox"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities]
set "ApplicationDescription" = "Firefox delivers safe, easy web browsing. A familiar user interface, enhanced security features including protection from online identity theft, and integrated search let you get the most out of the web."
set "ApplicationIcon" = '"$InstallDir32$\firefox.exe",0'
set "ApplicationName" = "Firefox"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities\FileAssociations]
set ".htm" = "FirefoxHTML-308046B0AF4A39CB"
set ".html" = "FirefoxHTML-308046B0AF4A39CB"
set ".shtml" = "FirefoxHTML-308046B0AF4A39CB"
set ".xht" = "FirefoxHTML-308046B0AF4A39CB"
set ".xhtml" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities\StartMenu]
set "StartMenuInternet" = "Firefox-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities\URLAssociations]
set "ftp" = "FirefoxURL-308046B0AF4A39CB"
set "http" = "FirefoxURL-308046B0AF4A39CB"
set "https" = "FirefoxURL-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\DefaultIcon]
set "" = '"$InstallDir32$\firefox.exe",0'

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\open\command]
set "" = "$InstallDir32$\firefox.exe"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\properties]
set "" = "Firefox &Options"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\properties\command]
set "" = '"$InstallDir32$\firefox.exe" -preferences'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\safemode]
set "" = "Firefox &Safe Mode"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\safemode\command]
set "" = '"$InstallDir32$\firefox.exe" -safe-mode'

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
set "Firefox-308046B0AF4A39CB" = "Software\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities"


openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$ProductId$]
set "Comments" = "Installed with OPSI"
set "DisplayIcon" = "$InstallDir32$\firefox.exe"
set "DisplayVersion" = "$DisplayVersion$"
set "NoModify" = REG_DWORD:00000001
set "NoRepair" = REG_DWORD:00000001
set "NoRemove" = REG_DWORD:00000001
set "Publisher" = "Mozilla"
set "DisplayName" = "$DisplayName$ $DisplayVersion$"
set "UninstallString" = "$InstallDir32$\firefox.exe"
set "InstallLocation" = "$InstallDir32$"

[Registry_install_64]
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.htm]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.html]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.shtml]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.xht]
set "" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\Software\Classes\.xhtml]
set "" = "FirefoxHTML-308046B0AF4A39CB"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB]
set "" = "Firefox HTML Document"
set "FriendlyTypeName" = "Firefox HTML Document"
set "EditFlags" = REG_DWORD:00000002
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\DefaultIcon]
set "" = '"$InstallDir64$\firefox.exe",1'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\shell]
set "" = "open"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\shell\open\command]
set "" = '"$InstallDir64$\firefox.exe" -osint -url "%1"'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB\shell\open\ddeexec]
set "" = ""

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB]
set "" = "Firefox URL"
set "FriendlyTypeName" = "Firefox URL"
set "URL Protocol" = ""
set "EditFlags" = REG_DWORD:00000002
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\DefaultIcon]
set "" = '"$InstallDir64$\firefox.exe",1'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell]
set "" = "open"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell\open\command]
set "" = '"$InstallDir64$\firefox.exe" -osint -url "%1"'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB\shell\open\ddeexec]
set "" = ""

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet]
set "" = "Firefox-308046B0AF4A39CB"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB]
set "" = "Mozilla Firefox"

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities]
set "ApplicationDescription" = "Firefox delivers safe, easy web browsing. A familiar user interface, enhanced security features including protection from online identity theft, and integrated search let you get the most out of the web."
set "ApplicationIcon" = '"$InstallDir64$\firefox.exe",0'
set "ApplicationName" = "Firefox"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities\FileAssociations]
set ".htm" = "FirefoxHTML-308046B0AF4A39CB"
set ".html" = "FirefoxHTML-308046B0AF4A39CB"
set ".shtml" = "FirefoxHTML-308046B0AF4A39CB"
set ".xht" = "FirefoxHTML-308046B0AF4A39CB"
set ".xhtml" = "FirefoxHTML-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities\StartMenu]
set "StartMenuInternet" = "Firefox-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities\URLAssociations]
set "ftp" = "FirefoxURL-308046B0AF4A39CB"
set "http" = "FirefoxURL-308046B0AF4A39CB"
set "https" = "FirefoxURL-308046B0AF4A39CB"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\DefaultIcon]
set "" = '"$InstallDir64$\firefox.exe",0'

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\open\command]
set "" = "$InstallDir64$\firefox.exe"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\properties]
set "" = "Firefox &Options"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\properties\command]
set "" = '"$InstallDir64$\firefox.exe" -preferences'
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\safemode]
set "" = "Firefox &Safe Mode"
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\shell\safemode\command]
set "" = '"$InstallDir64$\firefox.exe" -safe-mode'

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
set "Firefox-308046B0AF4A39CB" = "Software\Clients\StartMenuInternet\Firefox-308046B0AF4A39CB\Capabilities"


openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$ProductId$]
set "Comments" = "Installed with OPSI"
set "DisplayIcon" = "$InstallDir64$\firefox.exe"
set "DisplayVersion" = "$DisplayVersion$"
set "NoModify" = REG_DWORD:00000001
set "NoRepair" = REG_DWORD:00000001
set "NoRemove" = REG_DWORD:00000001
set "Publisher" = "Mozilla"
set "DisplayName" = "$DisplayName$ $DisplayVersion$"
set "UninstallString" = "$InstallDir64$\firefox.exe"
set "InstallLocation" = "$InstallDir64$"

[Registry_install_AllProfiles]
openkey [HKEY_CURRENT_USER\Software\Clients\StartMenuInternet]
set "" = "Firefox-308046B0AF4A39CB"

; Remove stored start menu order
deletekey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu]

[Registry_install_AllProfiles_win10]
openkey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
set ".htm" = 'wscript invis.vbs "%ProgramFiles32Dir%\SetDefaultBrowser\SetDefaultBrowser.exe" HKLM Firefox-308046B0AF4A39CB'

[Registry_install_AllClasses]
deletekey [HKEY_LOCAL_MACHINE\Software\Classes\.htm]
deletekey [HKEY_LOCAL_MACHINE\Software\Classes\.html]
deletekey [HKEY_LOCAL_MACHINE\Software\Classes\.shtml]
deletekey [HKEY_LOCAL_MACHINE\Software\Classes\.xht]
deletekey [HKEY_LOCAL_MACHINE\Software\Classes\.xhtml]
deletekey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML-308046B0AF4A39CB]
deletekey [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxURL-308046B0AF4A39CB]

[LinkFolder_install_32]
set_basefolder common_desktopdirectory
set_subfolder ""
set_link
	name: "Mozilla Firefox"
	target: "$InstallDir32$\firefox.exe"
	parameters:
	working_dir: "$InstallDir32$"
	icon_file: "$InstallDir32$\firefox.exe"
	icon_index: 0
end_link

set_basefolder common_programs
set_subfolder ""
set_link
	name: "Mozilla Firefox"
	target: "$InstallDir32$\firefox.exe"
	parameters:
	working_dir: "$InstallDir32$"
	icon_file: "$InstallDir32$\firefox.exe"
	icon_index: 0
end_link

[LinkFolder_install_64]
set_basefolder common_desktopdirectory
set_subfolder ""
set_link
	name: "Mozilla Firefox"
	target: "$InstallDir64$\firefox.exe"
	parameters:
	working_dir: "$InstallDir64$"
	icon_file: "$InstallDir64$\firefox.exe"
	icon_index: 0
end_link

set_basefolder common_programs
set_subfolder ""
set_link
	name: "Mozilla Firefox"
	target: "$InstallDir64$\firefox.exe"
	parameters:
	working_dir: "$InstallDir64$"
	icon_file: "$InstallDir64$\firefox.exe"
	icon_index: 0
end_link

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
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
The preferences came from ghacks. I hope you can follow this, it does a manual install of firefox 32 or 64 bit. I used to do autoconfig with a website, but that was harder to maintain. Now newer settings are deployed at the same time as a new firefox.
If you can read this you can find out where the error is in your script. Also, I hope you don't have to wrestle with autoconfig as much as I used to do.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von SisterOfMercy »

update3264.opsiscript:

Code: Alles auswählen

[Actions]
;SetLogLevel=9
requiredWinstVersion >= "4.11.5.14"

;DefVar $MsiId32$
;DefVar $UninstallProgram32$
;DefVar $MsiId64$
;DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $INST_SystemType$
;DefVar $INST_architecture$
DefVar $INST_MsVersion$

set $INST_MsVersion$ = GetMsVersionInfo
Set $INST_SystemType$ = GetSystemType
;set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"

; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, 
; no white space use '-' as a seperator
Set $ProductId$       = "mozilla-firefox"
Set $MinimumSpace$    = "500 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "%ProgramFiles32Dir%\Mozilla Firefox"
Set $InstallDir64$      = "%ProgramFiles64Dir%\Mozilla Firefox"
; ----------------------------------------------------------------

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
endif
if CompareDotSeparatedNumbers($INST_MsVersion$, "<", "5.1")
	LogError "Windows XP or newer is required for " + $ProductId$  
	isFatalError
endif
	
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$

comment "installing"

if ($INST_SystemType$ = "x86 System") or (CompareDotSeparatedNumbers($INST_MsVersion$, "<", "6"))
	Message "Installing " + $ProductId$ + "..."
	comment "Copy files"
	Files_install_32 /32Bit
	Files_install_AllProfiles /AllNtUserProfiles
	comment "Patch Registry"
	Registry_install /32Bit
	Registry_install_AllProfiles /AllNTUserDats
	comment "Create shortcuts"
	LinkFolder_install
	
	comment "Create firefox.js"
	PatchTextFile_firefox.js $InstallDir32$ + "\firefox.js"
	PatchTextFile_firefox.js_home $InstallDir32$ + "\firefox.js"
endif

if ($INST_SystemType$ = "64 Bit System") and (CompareDotSeparatedNumbers($INST_MsVersion$, ">=", "6"))
	Message "Installing " + $ProductId$ + "..."
	comment "Copy files"
	Files_install_64 /64Bit
	Files_install_AllProfiles /AllNtUserProfiles
	comment "Patch Registry"
	Registry_install /64Bit
	Registry_install_AllProfiles /AllNTUserDats
	comment "Create shortcuts"
	LinkFolder_install
	
	comment "Create firefox.js"
	PatchTextFile_firefox.js $InstallDir64$ + "\firefox.js"
	PatchTextFile_firefox.js_home $InstallDir64$ + "\firefox.js"
endif

[Files_install_32]
copy "%ScriptPath%\files\bookmarks.html" "$InstallDir32$\browser\defaults\profile"
copy "%ScriptPath%\files\xulstore.json" "$InstallDir32$\browser\defaults\profile"
copy "%ScriptPath%\files\custom.js" "$InstallDir32$\defaults\pref"
copy "%ScriptPath%\files\override.ini" "$InstallDir32$\browser"
delete -f "$InstallDir32$\firefox.js"

[Files_install_64]
copy "%ScriptPath%\files\bookmarks.html" "$InstallDir64$\browser\defaults\profile"
copy "%ScriptPath%\files\xulstore.json" "$InstallDir64$\browser\defaults\profile"
copy "%ScriptPath%\files\custom.js" "$InstallDir64$\defaults\pref"
copy "%ScriptPath%\files\override.ini" "$InstallDir64$\browser"
delete -f "$InstallDir64$\firefox.js"

[Files_install_AllProfiles]
; Example of recursively copying some files into each user profile directory:
;
; copy -s "%ScriptPath%\files\*.*" "%UserProfileDir%"

[Registry_install]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox]
set "DisableAppUpdate" = REG_DWORD:00000001
set "DisableTelemetry" = REG_DWORD:00000001
set "OverrideFirstRunPage" = ""
set "OverridePostUpdatePage" = ""
set "SearchBar" = "separate"
; If this policy is enabled, the default bookmarks and Smart Bookmarks (Most Visited, Recent Tags) are not created. Note: this policy is only effective if used before the first run of the profile.
set "NoDefaultBookmarks" = REG_DWORD:00000001
set "DisplayMenuBar" = REG_DWORD:00000001
set "DisablePocket" = REG_DWORD:00000001
set "DisableFirefoxStudies" = REG_DWORD:00000001
set "DisableBuiltinPDFViewer" = REG_DWORD:00000001
; Disable "It looks like you haven't started Firefox in a while. Do you want to clean it up for a fresh, like-new experience? And by the way, welcome back!"
set "DisableProfileRefresh" = REG_DWORD:00000001
; If this policy is enabled, Firefox Screenshots is not available. Stomme add-on om screenshots van webpagina's te maken. 
set "DisableFirefoxScreenshots" = REG_DWORD:00000001
; System Addons zijn dingen als pocket en zo: https://firefox-source-docs.mozilla.org/toolkit/mozapps/extensions/addon-manager/SystemAddons.html
set "DisableSystemAddonUpdate" = REG_DWORD:00000001

openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\Certificates]
set "ImportEnterpriseRoots" = REG_DWORD:00000001

[Registry_install_AllProfiles]
; Remove stored start menu order
deletekey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu]

[PatchTextFile_firefox.js]
DeleteAllLines_StartingWith ""
GoToBottom
AppendLine '// Custom settings file for Firefox'
AppendLine ''
AppendLine '//put everything in a try/catch'
AppendLine 'try {'
AppendLine ''
AppendLine 'const {classes: Cc, interfaces: Ci, utils: Cu} = Components;'
AppendLine 'Cu.import("resource://gre/modules/Services.jsm");'
AppendLine 'Cu.import("resource://gre/modules/FileUtils.jsm");'
AppendLine ''
AppendLine 'var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);'
AppendLine 'var certDBFile = profileDir.clone();'
AppendLine 'certDBFile.append("cert8.db")'
AppendLine '// If cert8.db is not there, it is a new profile'
AppendLine 'if (!certDBFile.exists()) {'
AppendLine '	var defaultProfileDir = Services.dirsvc.get("GreD", Ci.nsIFile);'
AppendLine '	defaultProfileDir.append("browser");'
AppendLine '	defaultProfileDir.append("defaults");'
AppendLine '	defaultProfileDir.append("profile");'
AppendLine '	try {'
AppendLine '		copyDir(defaultProfileDir, profileDir);'
AppendLine '	} catch (e) {'
AppendLine '		Components.utils.reportError(e);'
AppendLine '	}'
AppendLine '}'
AppendLine ''
AppendLine 'function copyDir(aOriginal, aDestination) {'
AppendLine '	var enumerator = aOriginal.directoryEntries;'
AppendLine '	while (enumerator.hasMoreElements()) {'
AppendLine '		var file = enumerator.getNext().QueryInterface(Components.interfaces.nsIFile);'
AppendLine '		if (file.isDirectory()) {'
AppendLine '			var subdir = aDestination.clone();'
AppendLine '			subdir.append(file.leafName);'
AppendLine '			try {'
AppendLine '				subdir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);'
AppendLine '				copyDir(file, subdir);'
AppendLine '			} catch (e) {'
AppendLine '				Components.utils.reportError(e);'
AppendLine '			}'
AppendLine '		} else {'
AppendLine '			try {'
AppendLine '				file.copyTo(aDestination, null);'
AppendLine '			} catch (e) {'
AppendLine '				Components.utils.reportError(e);'
AppendLine '			}'
AppendLine '		}'
AppendLine '	}'
AppendLine '}'
AppendLine ''
AppendLine '// Close the try, and call the catch()'
AppendLine '} catch(e) {'
AppendLine '	displayError("lockPref", e);'
AppendLine '}'

[PatchTextFile_firefox.js_home]
GoToBottom
; set Firefox to ESR update channel
Set_Mozilla_Pref ("lockPref", "app.update.channel", "esr")
; enable classic display
Set_Mozilla_Pref ("defaultPref", "browser.tabs.drawInTitlebar", false)
; always check if webpage is still current
Set_Mozilla_Pref ("defaultPref", "browser.cache.check_doc_frequency", 1)
; Disable smooth scrolling
Set_Mozilla_Pref ("defaultPref", "general.smoothScroll", false)
; Enable screenshots from dev tools
Set_Mozilla_Pref ("lockPref", "devtools.screenshot.clipboard.enabled", true)
; Take screenshot from the entire page
Set_Mozilla_Pref ("lockPref", "devtools.command-button-screenshot.enabled", true)

;	; 0000: disable about:config warning
;	Set_Mozilla_Pref ("lockPref", "general.warnOnAboutConfig", false)

; 0101: enable default browser check
Set_Mozilla_Pref ("defaultPref", "browser.shell.checkDefaultBrowser", true)
; 0102: set start page (0=blank, 1=home, 2=last visited page, 3=resume previous session)
Set_Mozilla_Pref ("defaultPref", "browser.startup.page", 3)
; 0103: set your "home" page
Set_Mozilla_Pref ("defaultPref", "browser.startup.homepage", "http://www.dilbert.com")
; 0104: set NEWTAB page
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.enabled", false)
Set_Mozilla_Pref ("lockPref", "browser.newtab.preload", false)
; 0105a: disable Activity Stream telemetry
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.feeds.telemetry", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.telemetry", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.telemetry.ping.endpoint", "")
; 0105b: disable Activity Stream Snippets
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.asrouter.providers.snippets", "")
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.feeds.snippets", false)
; 0105c: disable Activity Stream Top Stories, Pocket-based and/or sponsored content
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.feeds.section.topstories", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.section.highlights.includePocket", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.showSponsored", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.feeds.discoverystreamfeed", false)
; 105: personal preferences
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.feeds.section.highlights", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.feeds.topsites", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.prerender", false)
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.showSearch", false)

; 0201: disable Location-Aware Browsing
Set_Mozilla_Pref ("defaultPref", "geo.enabled", false)
; 0201b: set a default permission for Location (FF58+)
Set_Mozilla_Pref ("defaultPref", "permissions.default.geo", 2)
; 0206: disable geographically specific results/search engines e.g. "browser.search.*.US"
Set_Mozilla_Pref ("defaultPref", "browser.search.geoSpecificDefaults", false)
Set_Mozilla_Pref ("defaultPref", "browser.search.geoSpecificDefaults.url", "")
; 0207: set language to match
Set_Mozilla_Pref ("defaultPref", "intl.accept_languages", "en-US, en")
; 0209: use APP locale over OS locale in regional preferences [FF56+]
Set_Mozilla_Pref ("lockPref", "intl.regional_prefs.use_os_locales", true)
; 0211: disable using the OS's geolocation service
Set_Mozilla_Pref ("lockPref", "geo.provider.ms-windows-location", false)
Set_Mozilla_Pref ("lockPref", "geo.provider.use_corelocation", false)
Set_Mozilla_Pref ("lockPref", "geo.provider.use_gpsd", false)

;	; 0301a: disable auto-update checks for Firefox
;	Set_Mozilla_Pref ("lockPref", "app.update.enabled", false)
; 0301b: disable auto-update checks for extensions
Set_Mozilla_Pref ("lockPref", "extensions.update.enabled", false)
; 0302a: disable auto update installing for Firefox (after the check in 0301a)
Set_Mozilla_Pref ("lockPref", "app.update.auto", false)
; 0302b: disable auto update installing for extensions (after the check in 0301b)
Set_Mozilla_Pref ("lockPref", "extensions.update.autoUpdateDefault", false)
;	; 0303: disable background update service [WINDOWS]
;	Set_Mozilla_Pref ("lockPref", "app.update.service.enabled", false)
;	; 0304: disable background update staging
;	Set_Mozilla_Pref ("lockPref", "app.update.staging.enabled", false)
; 0306: disable extension metadata updating
Set_Mozilla_Pref ("lockPref", "extensions.getAddons.cache.enabled", false)
;	; 0307: disable auto updating of personas (themes)
;	Set_Mozilla_Pref ("lockPref", "lightweightThemes.update.enabled", false)
; 0308: disable search update
Set_Mozilla_Pref ("lockPref", "browser.search.update", false)
; 0309: disable sending Flash crash reports
Set_Mozilla_Pref ("lockPref", "dom.ipc.plugins.flash.subprocess.crashreporter.enabled", false)
; 0310: disable sending the URL of the website where a plugin crashed
Set_Mozilla_Pref ("lockPref", "dom.ipc.plugins.reportCrashURL", false)
; 0320: disable about:addons Get Add-ons panel (uses Google-Analytics)
Set_Mozilla_Pref ("lockPref", "extensions.getAddons.showPane", false)
Set_Mozilla_Pref ("lockPref", "extensions.webservice.discoverURL", "")
; 0321: disable recommendations in about:addons' Extensions and Themes panes [FF68+]
Set_Mozilla_Pref ("lockPref", "extensions.getAddons.discovery.api_url", "")
Set_Mozilla_Pref ("lockPref", "extensions.htmlaboutaddons.discover.enabled", false)
Set_Mozilla_Pref ("lockPref", "extensions.htmlaboutaddons.recommendations.enabled", false)


; 0330: disable telemetry
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.unified", false)
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.enabled", false)
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.server", "data:,")
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.archive.enabled", false)
;	Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.cachedClientID", "")
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.newProfilePing.enabled", false)
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.shutdownPingSender.enabled", false)
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.updatePing.enabled", false)
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.bhrPing.enabled", false)
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.hybridContent.enabled", false)
; 0331: disable Telemetry Coverage
Set_Mozilla_Pref ("lockPref", "toolkit.telemetry.coverage.opt-out", true)
Set_Mozilla_Pref ("lockPref", "toolkit.coverage.opt-out", true)
Set_Mozilla_Pref ("lockPref", "toolkit.coverage.endpoint.base", "")
; 0340: disable health report
Set_Mozilla_Pref ("lockPref", "datareporting.healthreport.uploadEnabled", false)
; 0341: disable new data submission, master kill switch (FF41+)
Set_Mozilla_Pref ("lockPref", "datareporting.policy.dataSubmissionEnabled", false)
; 0342: disable Studies (see 0503)
Set_Mozilla_Pref ("lockPref", "app.shield.optoutstudies.enabled", false)
; 0343: disable personalized Extension Recommendations in about:addons and AMO [FF65+]
Set_Mozilla_Pref ("lockPref", "browser.discovery.enabled", false)
; 0350: disable crash reports
Set_Mozilla_Pref ("lockPref", "breakpad.reportURL", "")
Set_Mozilla_Pref ("lockPref", "browser.tabs.crashReporting.sendReport", false)
Set_Mozilla_Pref ("lockPref", "browser.crashReports.unsubmittedCheck.enabled", false)
; 0351: disable sending of crash reports (FF44+)
Set_Mozilla_Pref ("lockPref", "browser.crashReports.unsubmittedCheck.autoSubmit2", false)
;	; 0360: disable new tab tile ads & preload & marketing junk
;	Set_Mozilla_Pref ("defaultPref", "browser.newtabpage.enabled", false)
;	Set_Mozilla_Pref ("defaultPref", "browser.newtab.preload", false)
;	; 0370: disable "Snippets" (Mozilla content shown on about:home screen) 
;	Set_Mozilla_Pref ("lockPref", "browser.aboutHomeSnippets.updateUrl", "data:,")
;	; 0380: disable Browser Error Reporter (FF60+)
;	Set_Mozilla_Pref ("lockPref", "browser.chrome.errorReporter.enabled", false)
;	Set_Mozilla_Pref ("lockPref", "browser.chrome.errorReporter.submitUrl", "")
; 0370: disable Pocket [FF46+]
Set_Mozilla_Pref ("lockPref", "extensions.pocket.enabled", false)
; 0390: disable Captive Portal detection
Set_Mozilla_Pref ("defaultPref", "captivedetect.canonicalURL", "http://detectportal.firefox.com/success.txt")
Set_Mozilla_Pref ("defaultPref", "network.captive-portal-service.enabled", false)
; 0391: disable Network Connectivity checks [FF65+]
Set_Mozilla_Pref ("lockPref", "network.connectivity-service.enabled", false)

; 0401: enforce Firefox blocklist, but sanitize blocklist url
Set_Mozilla_Pref ("lockPref", "extensions.blocklist.enabled", true)
Set_Mozilla_Pref ("lockPref", "extensions.blocklist.url", "https://blocklists.settings.services.mozilla.com/v1/blocklist/3/%APP_ID%/%APP_VERSION%/")
; 0402: disable binaries NOT in Safe Browsing local lists being checked
Set_Mozilla_Pref ("lockPref", "browser.safebrowsing.downloads.remote.enabled", false)
;	Set_Mozilla_Pref ("lockPref", "browser.safebrowsing.downloads.remote.url", "")
;	; 0417: disable data sharing (FF58+) ***/
;	Set_Mozilla_Pref ("lockPref", "browser.safebrowsing.provider.google4.dataSharing.enabled", false)
;	Set_Mozilla_Pref ("lockPref", "browser.safebrowsing.provider.google4.dataSharingURL", "")

;	; 0501: disable experiments
;	Set_Mozilla_Pref ("lockPref", "experiments.enabled", false)
;	Set_Mozilla_Pref ("lockPref", "experiments.manifest.uri", "")
;	Set_Mozilla_Pref ("lockPref", "experiments.supported", false)
;	Set_Mozilla_Pref ("lockPref", "experiments.activeExperiment", false)
;	; 0502: disable Mozilla permission to silently opt you into tests ***/
;	Set_Mozilla_Pref ("lockPref", "network.allow-experiments", false)
; 0503: disable Normandy/Shield (FF60+)
Set_Mozilla_Pref ("lockPref", "app.normandy.enabled", false)
Set_Mozilla_Pref ("lockPref", "app.normandy.api_url", "")
;	Set_Mozilla_Pref ("lockPref", "app.shield.optoutstudies.enabled", false)
; 0505: disable System Add-on updates
Set_Mozilla_Pref ("lockPref", "extensions.systemAddon.update.enabled", false)
Set_Mozilla_Pref ("lockPref", "extensions.systemAddon.update.url", "")
; 0506: disable PingCentre telemetry (used in several System Add-ons) [FF57+]
Set_Mozilla_Pref ("lockPref", "browser.ping-centre.telemetry", false)
;	; 0510: disable Pocket (FF39+)
;	Set_Mozilla_Pref ("lockPref", "extensions.pocket.enabled", false)
;	; 0514: disable Activity Stream (FF54+)
;	Set_Mozilla_Pref ("lockPref", "browser.library.activity-stream.enabled", false)
; 0515: disable Screenshots (FF55+)
Set_Mozilla_Pref ("lockPref", "extensions.screenshots.disabled", true)
Set_Mozilla_Pref ("lockPref", "extensions.screenshots.upload-disabled", true)
;	; 0516: disable Onboarding (FF55+)
;	Set_Mozilla_Pref ("lockPref", "browser.onboarding.enabled", false)
; 0517: disable Form Autofill
Set_Mozilla_Pref ("lockPref", "extensions.formautofill.addresses.enabled", false)
Set_Mozilla_Pref ("lockPref", "extensions.formautofill.available", "off")
Set_Mozilla_Pref ("lockPref", "extensions.formautofill.creditCards.enabled", false)
Set_Mozilla_Pref ("lockPref", "extensions.formautofill.heuristics.enabled", false)
; 0518: disable Web Compatibility Reporter (FF56+)
Set_Mozilla_Pref ("lockPref", "extensions.webcompat-reporter.enabled", false)

; 0601: disable link prefetching (werkt anders alleen met prefetch tag)
Set_Mozilla_Pref ("lockPref", "network.prefetch-next", false)
; 0602: disable DNS prefetching
Set_Mozilla_Pref ("lockPref", "network.dns.disablePrefetch", true)
Set_Mozilla_Pref ("lockPref", "network.dns.disablePrefetchFromHTTPS", true)
; 0603a: disable Seer/Necko
Set_Mozilla_Pref ("lockPref", "network.predictor.enabled", false)
; 0603: disable predictor / prefetching
Set_Mozilla_Pref ("lockPref", "network.predictor.enabled", false)
Set_Mozilla_Pref ("lockPref", "network.predictor.enable-prefetch", false)
;	; 0603b: disable more Necko/Captive Portal
;	Set_Mozilla_Pref ("lockPref", "captivedetect.canonicalURL", "")
;	Set_Mozilla_Pref ("lockPref", "network.captive-portal-service.enabled", false)
; 0605: disable link-mouseover opening connection to linked server
Set_Mozilla_Pref ("lockPref", "network.http.speculative-parallel-limit", 0)
; 0606: disable pings
Set_Mozilla_Pref ("lockPref", "browser.send_pings", false)
Set_Mozilla_Pref ("lockPref", "browser.send_pings.require_same_host", true)
;	; 0607: disable links launching Windows Store on Windows 8/8.1/10 [WINDOWS]
;	Set_Mozilla_Pref ("lockPref", "network.protocol-handler.external.ms-windows-store", false)
;	; 0608: disable predictor / prefetching (FF48+) ***/
;	Set_Mozilla_Pref ("lockPref", "network.predictor.enable-prefetch", false)

; 0703: disable HTTP Alternative Services (FF37+)
Set_Mozilla_Pref ("lockPref", "network.http.altsvc.enabled", false)
Set_Mozilla_Pref ("lockPref", "network.http.altsvc.oe", false)
; 0704: enforce the proxy server to do any DNS lookups when using SOCKS
Set_Mozilla_Pref ("lockPref", "network.proxy.socks_remote_dns", true)
; 0710: disable GIO as a potential proxy bypass vector
Set_Mozilla_Pref ("lockPref", "network.gio.supported-protocols", "")

; 0802: disable location bar domain guessing
Set_Mozilla_Pref ("defaultPref", "browser.fixup.alternate.enabled", false)
; 0803: display all parts of the url in the location bar
Set_Mozilla_Pref ("defaultPref", "browser.urlbar.trimURLs", false)
; 0805: disable CSS querying page history - CSS history leak - PRIVACY
Set_Mozilla_Pref ("lockPref", "layout.css.visited_links_enabled", false)
; 0807: disable live search suggestions
Set_Mozilla_Pref ("lockPref", "browser.search.suggest.enabled", false)
Set_Mozilla_Pref ("lockPref", "browser.urlbar.suggest.searches", false)
;	; 0808: Do not ask about search suggestions
;	Set_Mozilla_Pref ("lockPref", "browser.urlbar.userMadeSearchSuggestionsChoice", true)
; 0809: disable location bar suggesting "preloaded" top websites (FF54+)
Set_Mozilla_Pref ("lockPref", "browser.urlbar.usepreloadedtopurls.enabled", false)
; 0810: disable location bar making speculative connections (FF56+)
Set_Mozilla_Pref ("lockPref", "browser.urlbar.speculativeConnect.enabled", false)
; 0870: disable Windows jumplist
Set_Mozilla_Pref ("lockPref", "browser.taskbar.lists.enabled", false)
Set_Mozilla_Pref ("lockPref", "browser.taskbar.lists.frequent.enabled", false)
Set_Mozilla_Pref ("lockPref", "browser.taskbar.lists.recent.enabled", false)
Set_Mozilla_Pref ("lockPref", "browser.taskbar.lists.tasks.enabled", false)
; 0871: disable Windows taskbar preview
Set_Mozilla_Pref ("lockPref", "browser.taskbar.previews.enable", false)
 
; 0909: disable formless login capture for Password Manager (FF51+) ***/
Set_Mozilla_Pref ("lockPref", "signon.formlessCapture.enabled", false)

;	; 1007: disable randomized FF HTTP cache decay experiments
;	Set_Mozilla_Pref ("lockPref", "browser.cache.frecency_experiment", -1)


; 1203: disable SSL session tracking (FF36+)
Set_Mozilla_Pref ("lockPref", "security.ssl.disable_session_identifiers", true)
; 1204: disable SSL Error Reporting
Set_Mozilla_Pref ("lockPref", "security.ssl.errorReporting.automatic", false)
Set_Mozilla_Pref ("lockPref", "security.ssl.errorReporting.enabled", false)
Set_Mozilla_Pref ("lockPref", "security.ssl.errorReporting.url", "")
; 1205: disable TLS1.3 0-RTT (round-trip time) (FF51+)
Set_Mozilla_Pref ("lockPref", "security.tls.enable_0rtt_data", false)
; 1210: enable OCSP Stapling
Set_Mozilla_Pref ("lockPref", "security.ssl.enable_ocsp_stapling", true)
; 1211: control when to use OCSP fetching (to confirm current validity of certificates)
Set_Mozilla_Pref ("lockPref", "security.OCSP.enabled", 1)
; 1212: set OCSP fetch failures (non-stapled, see 1211) to hard-fail
Set_Mozilla_Pref ("lockPref", "security.OCSP.require", true)

; 1221: disable Windows 8.1s Microsoft Family Safety cert [WINDOWS] (FF50+)
Set_Mozilla_Pref ("lockPref", "security.family_safety.mode", 0)

; 1243: block unencrypted requests from Flash on encrypted pages to mitigate MitM attacks [FF59+]
Set_Mozilla_Pref ("lockPref", "security.mixed_content.block_object_subrequest", true)

; 1270: display warning (red padlock) for "broken security"
Set_Mozilla_Pref ("lockPref", "security.ssl.treat_unsafe_negotiation_as_broken", true)
; 1272: display advanced information on Insecure Connection warning pages
Set_Mozilla_Pref ("lockPref", "browser.xul.error_pages.expert_bad_cert", true)
; 1273: display "insecure" icon (FF59+) and "Not Secure" text (FF60+) on HTTP sites (later misschien gebruiken)
;Set_Mozilla_Pref ("lockPref", "security.insecure_connection_icon.enabled", true)

;	; 1402: set more legible default fonts [SETUP]
;	Set_Mozilla_Pref ("defaultPref", "font.name.serif.x-unicode", "Georgia")
;	Set_Mozilla_Pref ("defaultPref", "font.name.serif.x-western", "Georgia")
;	Set_Mozilla_Pref ("defaultPref", "font.name.sans-serif.x-unicode", "Arial")
;	Set_Mozilla_Pref ("defaultPref", "font.name.sans-serif.x-western", "Arial")
;	Set_Mozilla_Pref ("defaultPref", "font.name.monospace.x-unicode", "Lucida Console")
;	Set_Mozilla_Pref ("defaultPref", "font.name.monospace.x-western", "Lucida Console")
;	; 1407: disable special underline handling for a few fonts which you will probably never use
;	Set_Mozilla_Pref ("defaultPref", "font.blacklist.underline_offset", "")

;	; 1801: set default plugin state (i.e. new plugins on discovery) to always activate
;	Set_Mozilla_Pref ("defaultPref", "plugin.default.state", 2)
;	Set_Mozilla_Pref ("defaultPref", "plugin.defaultXpi.state", 2)
;  1803: enable/disable Flash plugin
Set_Mozilla_Pref ("defaultPref", "plugin.state.flash", 2)
; 1825: disable widevine CDM (Content Decryption Module)
Set_Mozilla_Pref ("defaultPref", "media.gmp-widevinecdm.visible", true)
Set_Mozilla_Pref ("defaultPref", "media.gmp-widevinecdm.enabled", true)
; 1830: disable all DRM content (EME: Encryption Media Extension)
Set_Mozilla_Pref ("defaultPref", "media.eme.enabled", true)
;	Set_Mozilla_Pref ("lockPref", "browser.eme.ui.enabled", false)
;	; 1840: disable the OpenH264 Video Codec by Cisco to "Never Activate"
;	Set_Mozilla_Pref ("lockPref", "media.gmp-gmpopenh264.enabled", false)
;	Set_Mozilla_Pref ("lockPref", "media.gmp-gmpopenh264.autoupdate", false)

; 2001: disable WebRTC (Web Real-Time Communication)
Set_Mozilla_Pref ("defaultPref", "media.peerconnection.enabled", true)
; 2024: set a default permission for Camera/Microphone (FF58+)
Set_Mozilla_Pref ("defaultPref", "permissions.default.camera", 2)
Set_Mozilla_Pref ("defaultPref", "permissions.default.microphone", 2)

; 2201: prevent websites from disabling new window features
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.close", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.location", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.menubar", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.minimizable", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.personalbar", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.resizable", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.status", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.titlebar", true)
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_open_feature.toolbar", true)
; 2202: prevent scripts moving and resizing open windows
Set_Mozilla_Pref ("defaultPref", "dom.disable_window_move_resize", true)
; 2210: block popup windows
Set_Mozilla_Pref ("defaultPref", "dom.disable_open_during_load", true)
;	; 2211: set max popups from a single non-click event - default is 20! ***/
;	Set_Mozilla_Pref ("defaultPref", "dom.popup_maximum", 5)

; 2302: disable service workers
Set_Mozilla_Pref ("defaultPref", "dom.serviceWorkers.enabled", false)
; 2304: disable web notifications
Set_Mozilla_Pref ("defaultPref", "dom.webnotifications.enabled", false)
Set_Mozilla_Pref ("defaultPref", "dom.webnotifications.serviceworker.enabled", false)
; 2305: disable push notifications (FF44+)
Set_Mozilla_Pref ("defaultPref", "dom.push.enabled", false)
Set_Mozilla_Pref ("defaultPref", "dom.push.connection.enabled", false)
Set_Mozilla_Pref ("defaultPref", "dom.push.serverURL", "")
Set_Mozilla_Pref ("defaultPref", "dom.push.userAgentID", "")
; 2306: set a default permission for Notifications (see 2304) (FF58+)
Set_Mozilla_Pref ("defaultPref", "permissions.default.desktop-notification", 2)

; 2401: disable website control over browser right-click context menu
Set_Mozilla_Pref ("defaultPref", "dom.event.contextmenu.enabled", false)
; 2402: disable website access to clipboard events/content -> enabled, facebook messenger fix
Set_Mozilla_Pref ("defaultPref", "dom.event.clipboardevents.enabled", true)
; 2403: disable clipboard commands (cut/copy) from "non-privileged" content (FF41+)
Set_Mozilla_Pref ("defaultPref", "dom.allow_cut_copy", false)
; 2414: disable shaking the screen
Set_Mozilla_Pref ("defaultPref", "dom.vibrator.enabled", false)
; 2420: disable asm.js (FF22+)
Set_Mozilla_Pref ("lockPref", "javascript.options.asmjs", false)
; 2422: disable WebAssembly for now (FF52+)
Set_Mozilla_Pref ("lockPref", "javascript.options.wasm", false)
; 2426: disable Intersection Observer API (FF53+)
Set_Mozilla_Pref ("lockPref", "dom.IntersectionObserver.enabled", false)
;	; 2427: disable Shared Memory (Spectre mitigation)
;	Set_Mozilla_Pref ("lockPref", "javascript.options.shared_memory", false)
; 2429: enable (limited but sufficient) window.opener protection [FF65+]
Set_Mozilla_Pref ("lockPref", "dom.targetBlankNoOpener.enabled", true)

; 2505: disable media device enumeration (FF29+) WebRTC
Set_Mozilla_Pref ("defaultPref", "media.navigator.enabled", true)

; 2601: prevent accessibility services from accessing your browser [RESTART]
Set_Mozilla_Pref ("defaultPref", "accessibility.force_disabled", 1)
; 2602: disable sending additional analytics to web servers
Set_Mozilla_Pref ("lockPref", "beacon.enabled", false)
; 2604: disable page thumbnail collection (only used for new tab window)
Set_Mozilla_Pref ("lockPref", "browser.pagethumbnails.capturing_disabled", true)
; 2606: disable UITour backend so there is no chance that a remote page can use it ***/
Set_Mozilla_Pref ("lockPref", "browser.uitour.enabled", false)
Set_Mozilla_Pref ("lockPref", "browser.uitour.url", "")
; 2607: disable various developer tools in browser context
Set_Mozilla_Pref ("defaultPref", "devtools.chrome.enabled", false)
; 2608: disable WebIDE to prevent remote debugging and extension downloads
Set_Mozilla_Pref ("lockPref", "devtools.webide.autoinstallADBHelper", false)
Set_Mozilla_Pref ("lockPref", "devtools.debugger.remote-enabled", false)
Set_Mozilla_Pref ("lockPref", "devtools.webide.enabled", false)
; 2611: disable middle mouse click opening links from clipboard
Set_Mozilla_Pref ("defaultPref", "middlemouse.contentLoadURL", false)
;	; 2612: disable remote JAR files being opened, regardless of content type (FF42+)
;	Set_Mozilla_Pref ("lockPref", "network.jar.block-remote-files", true)
;	; 2613: disable JAR from opening Unsafe File Types ***/
;	Set_Mozilla_Pref ("lockPref", "network.jar.open-unsafe-types", false)
; 2616: remove special permissions for certain mozilla domains (FF35+)
Set_Mozilla_Pref ("defaultPref", "permissions.manager.defaultsUrl", "")
; 2617: remove webchannel whitelist
Set_Mozilla_Pref ("defaultPref", "webchannel.allowObject.urlWhitelist", "")
; 2619: enforce Punycode for Internationalized Domain Names to eliminate possible spoofing
Set_Mozilla_Pref ("defaultPref", "network.IDN_show_punycode", true)
; 2620: disable Firefoxs built-in PDF reader
Set_Mozilla_Pref ("defaultPref", "pdfjs.disabled", true)
; 2621: disable links launching Windows Store on Windows 8/8.1/10 [WINDOWS]
Set_Mozilla_Pref ("lockPref", "network.protocol-handler.external.ms-windows-store", false)
; 2622: disable middlemouse paste leaking on Linux
Set_Mozilla_Pref ("lockPref", "middlemouse.paste", false)
; 2652: disable adding downloads to the systems "recent documents" list
Set_Mozilla_Pref ("lockPref", "browser.download.manager.addToRecentDocs", false)
; 2653: disable hiding mime types (Options>General>Applications) not associated with a plugin
Set_Mozilla_Pref ("defaultPref", "browser.download.hide_plugins_without_extensions", false)
; 2660: unlock allowed extension directories
Set_Mozilla_Pref ("defaultPref", "extensions.enabledScopes", 15)
Set_Mozilla_Pref ("defaultPref", "extensions.autoDisableScopes", 0)

; 2730: disable offline cache
Set_Mozilla_Pref ("lockPref", "browser.cache.offline.enable", false)
;	; 2730b: disable offline cache on insecure sites (FF60+)
;	Set_Mozilla_Pref ("lockPref", "browser.cache.offline.insecure.enable", false)
; 2731: enforce websites to ask to store data for offline use
;Set_Mozilla_Pref ("lockPref", "offline-apps.allow_by_default", false)

; 5000: Don't show what is new after update
Set_Mozilla_Pref ("lockPref", "browser.startup.homepage_override.mstone", "ignore")
Set_Mozilla_Pref ("lockPref", "startup.homepage_welcome_url", "")
Set_Mozilla_Pref ("lockPref", "startup.homepage_welcome_url.additional", "")
Set_Mozilla_Pref ("lockPref", "startup.homepage_override_url", "")
; 5000: Warnings
Set_Mozilla_Pref ("defaultPref", "browser.tabs.warnOnOpen", false)
Set_Mozilla_Pref ("lockPref", "general.warnOnAboutConfig", false)
Set_Mozilla_Pref ("lockPref", "browser.aboutConfig.showWarning", false)
; 5000: Appearance
Set_Mozilla_Pref ("defaultPref", "browser.download.autohideButton", false)
Set_Mozilla_Pref ("lockPref", "toolkit.cosmeticAnimations.enabled", false)
; 5000: Content Behaviour
Set_Mozilla_Pref ("defaultPref", "accessibility.typeaheadfind", true)
Set_Mozilla_Pref ("defaultPref", "layout.spellcheckDefault", 0)
; [SETTING] General>Browsing>Recommend extensions as you browse
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false)
; [SETTING] General>Browsing>Recommend features as you browse
Set_Mozilla_Pref ("lockPref", "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false)
; 5000: disable and hide Firefox Accounts and Sync (FF60+)
Set_Mozilla_Pref ("lockPref", "identity.fxaccounts.enabled", false)
; 5000: Do not autodetect offline status
Set_Mozilla_Pref ("defaultPref", "network.manage-offline-status", false)
; 5000: Disable reader mode
Set_Mozilla_Pref ("defaultPref", "reader.parse-on-load.enabled", false)
; 5000: Do not require extensions to be signed
Set_Mozilla_Pref ("lockPref", "xpinstall.signatures.required", false)


[LinkFolder_install]
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of creating an shortcut to the installed exe in AllUsers startmenu:
;
; set_basefolder common_programs
; set_subfolder $ProductId$
;
; set_link
; 	name: $ProductId$
; 	target: <path to the program>
; 	parameters:
; 	working_dir: $InstallDir$
; 	icon_file:
; 	icon_index:
; end_link
;
; Example of creating an shortcut to the installed exe on AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
;
; set_link
; 	name: $ProductId$
; 	target: <path to the program>
; 	parameters: <some_param>
; 	working_dir: $InstallDir$
; 	icon_file: <path to icon file>
; 	icon_index: 2
; end_link


[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
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
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von SisterOfMercy »

custom.js

Code: Alles auswählen

// Custom settings file for Mozilla Firefox
pref("general.config.filename", "firefox.js");
pref('general.config.obscure_value', 0);
pref("general.config.sandbox_enabled", false);
xulstore.json

Code: Alles auswählen

{
	"chrome://browser/content/browser.xul":
	{
		"main-window":
		{
			"sizemode":"maximized"
		},
		"toolbar-menubar":
		{
			"autohide":"false"
		}
	}
}
override.ini (not sure if this is still used)

Code: Alles auswählen

[XRE]
EnableProfileMigrator=false
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
thomas.besser
Beiträge: 455
Registriert: 09 Sep 2009, 09:40

Re: Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von thomas.besser »

Code: Alles auswählen

[Files_install]
copy -s "%scriptpath%\files\override.ini" "$InstallDir$\browser\."
produziert...

Code: Alles auswählen

[3] [Dez 11 15:50:59:882] [firefox]   Error:  Directory p:\firefox\files\%ProgramFiles%\Mozilla Firefox\browser does not exist and cannot be created
Offensichtlich ist der Wert von $InstallDir$ falsch.
Benutzeravatar
ThomasT
uib-Team
Beiträge: 529
Registriert: 26 Jun 2013, 12:26

Re: Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von ThomasT »

Die ProgramFiles Konstante heißt %ProgramFilesDir%
Nicht wie hier:
Set $InstallDir$ = "%ProgramFiles%\Mozilla Firefox"

https://download.uib.de/opsi4.1/documen ... st-system1
Kein Support per DM!
_________________________
opsi support - https://www.uib.de/
For productive opsi installations we recommend support contracts.
rbroda
Beiträge: 23
Registriert: 24 Jul 2017, 15:26

[Gelöst] Firefox Paket Dateien in Verzeichnis kopieren

Beitrag von rbroda »

Ja, lag daran:

Falsch:
Set $InstallDir$ = "%ProgramFiles%\Mozilla Firefox"

Richtig:
Set $InstallDir$ = "%ProgramFiles64Dir%\Mozilla Firefox"

Vielen Dank!
Antworten