Link to home
Start Free TrialLog in
Avatar of scotslad
scotslad

asked on

How do I get fonts to install when I install app?

I have an application which uses special fonts. I need these fonts to be installed into the fonts directory when the s/w is installed. How do I go about doing this? I am using VB5 enterprise and the Application Setup Wizard. I do not want to have to copy the files into the fonts directory myself and I do not want to use:

    Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long

I want the fonts to be installed automatically with the software. Thanks in advance.
Avatar of MikeP090797
MikeP090797

SW doesn't provides that capability. You can make SW copy the fonts to your app's directory, and then install them, and delelte them on the first run.
Avatar of scotslad

ASKER

If this is the case, how do I determine the windows path since the path differs from Win95/98 to Win NT and the user may change the deault name for the windows directory as well? Also I would only want to do this the first time the program is run. How can I test that the fonts are installed successfully so I don't try to install them again?

You can use these API's:

Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

ASKER CERTIFIED SOLUTION
Avatar of MikeP090797
MikeP090797

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, didn't see the comment when posted the answer
One last point then. If I use FileCopy and Kill to copy the files then delete them, how do I check if the file is in the directory. Pretty simple I know but I haven't had to check if a file exists before.

Cheers.

Use Dir:

If Dir("C:\Dir1\File1.dat")<> "" then 'File exist
Bought This Question.