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.
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.
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.
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry, didn't see the comment when posted the answer
ASKER
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.
Cheers.
Use Dir:
If Dir("C:\Dir1\File1.dat")<> "" then 'File exist
If Dir("C:\Dir1\File1.dat")<>
Bought This Question.