Fontinstallation

mensch90
Beiträge: 130
Registriert: 27 Jul 2013, 16:52

Re: Fontinstallation

Beitrag von mensch90 »

Mach es dir doch nicht so kompliziert:

Installiere in einer Referenz-VM vor der händischen, korrekten Fontinstallation einfach Regshot. Mache einen Snapshot. Installiere dann die Fonts, mache einen erneuten Snapshot und vergleiche die Snapshots.
Die Veränderungen exportierst du mittels Regedit aus der Registry, bereinigst die *.reg-Datei von Standardeinträgen und importierst einfach in deinem Opsi-Script den Export in einer DosInAnIcon-Sektion mittels regedit.exe /s blah... ;)
hawaii
Beiträge: 77
Registriert: 03 Dez 2013, 13:32

Re: Fontinstallation

Beitrag von hawaii »

Hi,

ich benutze dazu das Tool FontReg:

http://www.richud.com/wiki/Windows_Font ... ely_easily
http://code.kliu.org/misc/fontreg/

Dazu verwende ich dieses Script hier, es muss dazu in CLIENT_DATA einen Ordner fonts geben, welcher sowohl die Schriftarten als auch die FontReg.exe enthält.

Grüßle,
Kai

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.
; credits: http://www.opsi.org/en/credits/

[Actions]
requiredWinstVersion >= "4.11.2.6"

DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $InstPrg$
DefVar $TmpPath$

Set $LogDir$ = "%SystemDrive%\tmp"

; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "fonts"
Set $MinimumSpace$    = "10 MB"
; the path were we find the product after the installation
Set $InstallDir$      = "%ProgramFiles32Dir%\<path to the product>"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
Set $InstPrg$         = "FontReg.exe"
Set $TmpPath$         = "%Systemdrive%\temp"
; ----------------------------------------------------------------

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
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
	
	if FileExists("%ScriptPath%\delsub32.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub32.ins"
	endif
	
	Message "Installing " + $ProductId$ + " ..."
	
	if $LicenseRequired$ = "true"
		comment "Licensing required, reserve license and get license key"
		Sub_get_licensekey
	endif
	
	comment "Start setup program"
	Files_install
	DosInAnIcon_do /64Bit
	Files_uninstall	

endif

[Files_install]
copy %ScriptPath%\fonts\* $TmpPath$\fonts

[DosInAnIcon_do]
cd $TmpPath$\fonts
$InstPrg$ /copy

[Files_uninstall]
del -sf "$TmpPath$\"

[Sub_get_licensekey]
if opsiLicenseManagementEnabled
	comment "License management is enabled and will be used"

	comment "Trying to get a license key"
	Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
	; If there is an assignment of exactly one licensepool to the product the following call is possible:
	; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
	;
	; If there is an assignment of a license pool to a windows software id, it is possible to use:
	; DefVar $WindowsSoftwareId$
	; $WindowsSoftwareId$ = "..."
	; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
	
	DefVar $ServiceErrorClass$
	set $ServiceErrorClass$ = getLastServiceErrorClass
	comment "Error class: " + $ServiceErrorClass$
	
	if $ServiceErrorClass$ = "None"
		comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
	else
		if $ServiceErrorClass$ = "LicenseConfigurationError"
			LogError "Fatal: license configuration must be corrected"
			LogError getLastServiceErrorMessage
			isFatalError
		else 
			if $ServiceErrorClass$ = "LicenseMissingError"
				LogError "Fatal: required license is not supplied"
				isFatalError
			endif
		endif
	endif
else
	LogError "Fatal: license required, but license management not enabled"
	isFatalError
endif
holgerv
Beiträge: 288
Registriert: 20 Aug 2012, 09:35

Re: Fontinstallation

Beitrag von holgerv »

D1Ck3n hat geschrieben:Ich will einfach nur eine neue Schriftart überall auf unsere Win 7 Maschienen verteilen, aber irgendwie klappt das nicht :?:
Was sagt denn das Logfile?
deckel
Beiträge: 2
Registriert: 13 Aug 2014, 11:56

Re: Fontinstallation

Beitrag von deckel »

Hallo,

also ich nutze das Script : https://www.cloudtec.ch/blog/tech/insta ... ows-7.html

Dort einfach in Zeile 17. den Netzwerkpfad angeben wo die Fonts liegen.


Das Skript muss natürlich im Opsi Depot verfügbar sein.

Dann einfach im Installationsskript von Opsi

[Dosbatch_installFonts]
cscript %ScriptPath%/install_fonts.vbs

ausführen lassen und fertig.

Gruß

David
tslinden
Beiträge: 9
Registriert: 20 Okt 2016, 12:28

Re: Fontinstallation

Beitrag von tslinden »

Auch wenn das Thema uralt ist, vielleicht benötigt ja jemand das Skript noch. Ich stand gerade vor dem Problem und möchte euch meine Lösung natürlich nicht vorenthalten. Es ist fast der gleiche Code wie ein paar Posts vorher, funktioniert aber ;)

Grüße,
ts

Code: Alles auswählen

.... Header und alles was man sonst noch haben will ....

message "Kopiere Schriftarten..."
Files_copy
Message "Fertig."

Message "Setze Registry Keys..."
Registry_edit
Message "Fertig"

[Files_copy]
copy -V "%ScriptPath%\Fonts\*.ttf" "C:\Windows\Fonts\"

[Registry_edit]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
set "xyz (TrueType)"="xyz.ttf"

.... Hier die anderen Schriftarten Typen noch einfügen ....
OPSI 4.1 @ Ubuntu
Antworten