How do I...?

Copy a File to the Hard Drive

It is often useful to copy a file from a CD-ROM (or other media) to the user's computer. In AutoPlay Media Studio, this is accomplished with a File.Copy action.

As an example, we will load a specific font onto the user's computer:

--get the destination directory (in this case, where the fonts are stored)
fonts_dir = Shell.GetFolder(SHF_FONTS);

--copy the file from your cd to the user's font directory
File.Copy(_SourceFolder .. "\\my_font.ttf", fonts_dir..\\"my_font.ttf", false, true, false, true, nil);

--register the font with windows
System.RegisterFont(fonts_dir .. "\\myfont.ttf", "My Font Name", true);

 

Сайт управляется системой uCoz