How do I...?

Copy a File to the Hard Drive

It is often useful to copy a file from CD-ROM to the user's computer. In AutoPlay Media Studio 5.0, 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); -- Get the path to the user's Font directory.

--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);


Applies to:

Professional Edition