PDA

View Full Version : Copying (or installing) files/fonts from inside the project to user's pc


nmour
06-03-2006, 09:04 AM
Let's say that we have a 5 page presentation, page 1 is introduction, page 2 is the main presentation page and pages (3,4,5) are the presentation's material.

In Page 1 where the introduction is it has 2 buttons - enter and exit. I want to make the "enter" button to work as follows : when it will be pressed i want the fonts located in the root of the cd to be installed automatically BEFORE user enters the page 2 which uses theses fonts that most users usually don't have (these fonts are immitation of byzantine style of writing - the whole presentation is about byzantine art icons to be more exact) so that when the page 2 is loaded the user will already have the fonts installed in his windows folder directory. In this case the presentation will work flawlessly....i guess !

But my problem is that i don't know if i can make it happen without the knowledge of the user or do i have to make another page between page 1 and 2, asking of him to push a button so he can install the fonts ? To give u a hint the install package of the fonts (in this case file fonts32.exe) includes all the fonts i need (all these fonts are zipped inside the package) but also i have all of the fonts as individual files (*.ttf) in a seperated folder inside the root. So the question is which one does the job best ? The package that needs the confirmation of the user to install them or directly install the individual files in the system without the confirmation of the user ? In the second case it has to be a time frame of at least 5 seconds (which are more than enough for registering the fonts to the system) before the user enters the main presentation page.

It's really confusing.... Any ideas ?
Thanx again for all and sorry for the trouble i may cause you with all that details....

Wonderboy
06-03-2006, 11:16 AM
I would Install all the fonts when the application started for the first time , when page one was running,that way you would be sure that all your fonts would be displayd whenever you want them to be used for the user, whenever the user pushed the following buttons for each of your following pages, or if you want to do it with a button for each page when the user pushes the button that jumps to as an example page 2, then on this button you could use this on Click on your Enter butoon
File.Copy("AutoPlay\\Docs\\My_Font.ttf", _WindowsFolder.."\\Fonts\\My_Font.ttf", true, true, false, true, nil);
Application.Sleep(250);
Page.Jump("Page2");

the application sleep is just acting as a delay to make sure the fonts are ready to use for that page,
and no the user wont notice what happend, except that the next page whas loaded.

nmour
06-03-2006, 11:38 AM
I would Install all the fonts when the application started for the first time , when page one was running,that way you would be sure that all your fonts would be displayd whenever you want them to be used for the user, whenever the user pushed the following buttons for each of your following pages, or if you want to do it with a button for each page when the user pushes the button that jumps to as an example page 2, then on this button you could use this on Click on your Enter butoon
File.Copy("AutoPlay\\Docs\\My_Font.ttf", _WindowsFolder.."\\Fonts\\My_Font.ttf", true, true, false, true, nil);
Application.Sleep(250);
Page.Jump("Page2");

the application sleep is just acting as a delay to make sure the fonts are ready to use for that page,
and no the user wont notice what happend, except that the next page whas loaded.

Thanx for the tip wonderboy , i'll try it !

Wonderboy
06-03-2006, 11:42 AM
Np, post back if you have any problems