Solved

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

Posted on 1998-09-11
8
174 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:scotslad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1434315
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.
0
 

Author Comment

by:scotslad
ID: 1434316
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?

0
 
LVL 2

Expert Comment

by:shchuka
ID: 1434317
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

0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1434318
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


Use those API's to get windows or system path, whatever you need.
AddFontResource  will return 0 in case of error. To make sure you install the fonts only once, just delete them from the program's directory, and check if they are there before you install them
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1434319
sorry, didn't see the comment when posted the answer
0
 

Author Comment

by:scotslad
ID: 1434320
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.

0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1434321
Use Dir:

If Dir("C:\Dir1\File1.dat")<> "" then 'File exist
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1434322
Bought This Question.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Suggested Courses
Course of the Month5 days, 10 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question