Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to install fonts with app
Message
From
26/09/1999 14:32:12
 
 
To
25/09/1999 16:12:52
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00268841
Message ID:
00269127
Views:
16
>Thanks. I'll give your method a try. Could you please post/email any code you used to do this?
>
>Scott
>
>
>>>How do I include a couple of barcode fonts in the setup, so they are installed with the application? I tried copying them into the source directory, but there was no option to install them into the Windows\Fonts directory of the target PC. I tried including them in the project, but the setup wizard doesn't see them as files to be included separately. I also tried to add them to the project but leave them excluded. This didn't work either. Help!!!
>>
>>Scott,
>>
>>I had to also install a set of fonts...not barcode but others. I had the same problem. The final resolution was to build it into the application itself and when it was run the first time, I checked for the existance of the fonts on the system and if they weren't there then copy them over and display a message to the user to reboot their pc so the fonts would automatically register themselves when windows restarted.
>>
>>If you find a better way, let me know. <g>
>>
>>Pat.

Here's the code that I used. It assumes that there is a font directory in your application path that you are storing the fonts that you want loaded in. I also display a message giving the user the option to reboot or to exit and reboot later. It's not the prettiest in the display on UT but you can get the gist of it when you space it out correctly. For some reason I can't get the UT interface to space things out the way I want them. <g>

Pat.


lcWindows = getenv('windir')

llUpdated = .F.
IF !empty(lcWindows)
lnCount = adir(laFonts,'fonts\*.ttf')
If lnCount > 0
for i = 1 to alen(laFonts,1)
if !file(lcWindows+"\Fonts\"+alltrim(laFonts(i,1)))
Copy file 'fonts\'+alltrim(laFonts(i,1)) to lcWindows+'\Fonts\'+alltrim(laFonts(i,1))
llUpdated = .T.
endif
endfor
endif
endif

If llUpdated
lnAnswer = Messagebox("Needed Fonts had to be installed into your Windows Fonts directory."+chr(13)+ ;
"The applicaton will not run properly until the fonts are initialized."+chr(13)+ ;
"Shutting Down and restarting Windows will initialize those fonts."+chr(13)+ ;
"Do you wish to shutdown and restart now? Selecting 'Yes' will prompt you to"+chr(13)+ ;
"restart Windows. Selecting 'No' will terminate the application so that you"+chr(13)+ ;
"can restart Windows at your convenience.",68,"Fonts Update...")
If lnAnswer = 6
lnAnswer2 = Messagebox("Are you sure you want to do this? If not then select 'No' and "+chr(13)+ ;
“the application will terminate so that you may restart Windows. Otherwise, "+chr(13)+ ;
"be sure to exit all existing Windows Applications before shutting down. "+chr(13)+ ;
"When you have shut down all applications, select 'Yes' and Windows will restart.",68,"Shutdown...")
If lnAnswer2 = 6
* Exit and Restart Windows 66=exit and restart 67=exit for good
lnExitType = 66
DECLARE INTEGER ExitWindowsEx IN user32 INTEGER, INTEGER
lnExitWindows=ExitWindowsEx(lnExitType,0)
Else
Wait Window "Shutting Down…" NOWAIT
Return .F.
Endif
Else
Wait Window "Shutting Down…" NOWAIT
Return .F.
Endif
Endif

llContinue=DODEFAULT()

RETURN llContinue
Patrick L. Stovall
Senior Architect/Developer
MCP - C#

VeroQuest
P.O.Box 7216
Kalispell, MT 59904
Previous
Reply
Map
View

Click here to load this message in the networking platform