Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Fonts installieren?


1 reply to this topic

AndreasH

AndreasH
  • Members
  • 4 posts

Posted 14 March 2003 - 15:18

Hallo,

wie kann man Fonts installieren? Über Dateigruppen und
Zielverzeichnis auswählen funktionierts nicht.

Gruß
Andreas

stanhale

stanhale
  • Members
  • 4 posts

Posted 18 March 2003 - 10:48

Hallo,
lege einfach eine Dateigruppe (z.B. Fonts) und eine Komponente (z.B. Fonts) an, in die Du die zu installierenden Fonts einbettest. Ziel sollte ein Scriptdefinierter Ordner sein (z.B. <fontdir>.

Dann ermittelst Du den Fontordner (BS - Abhängig):
InstallFont:

RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
if (RegDBKeyExist( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\FONTS" ) = 1) then
    fontpath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\FONTS";
   endif;
   
   if (RegDBKeyExist ("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FONTS") = 1) then
    fontpath = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FONTS";
   endif;
   
   if (fontpath = "") then
    MessageBox ("Fontinstallation fehlgeschlagen, RegError, Bitte wenden Sie sich an unseren Support", SEVERE);
   endif;
   //WINDIR bestimmen
   fontdir = WINDIR^"Fonts";
   ComponentSelectItem ( MEDIA, "Fonts", TRUE);
   ComponentSetTarget ( MEDIA, "<fontdir>", fontdir);  

Ganz zum Schluß musst Du denn neuen Font im System "bekanntgeben". Im Prototypbereich:
#define HWND_BROADCAST 0xFFFF
#define WM_FONTCHANGE 0x001D
prototype INT GDI32.AddFontResource(BYREF STRING);

Am Ende der Installation (z.B. OnFirstUIAfter():)
dummy = "fontname.ttf";
svFontFile = fontdir^dummy;  
nResult = AddFontResource(svFontFile);
if (nResult = 0) then
MessageBox ( "Bitte überprüfen Sie in der Systemsteuerung die Installation der Schriftart fontname" , INFORMATION );
endif;    
SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);
end;