| Use Gui4Cli for CD AutoPlay |
| Windows has a feature called AutoPlay to
allow you to automatically run a program when a CD is inserted into a CD-ROM drive. When Windows realizes that a CD has been inserted, it will search for a file named Autorun.inf. This is a text file (like a script file) specifying the name of the executable to run and, optionally, an icon to represent the CD in file listings. You can use Gui4Cli as the executable, and instruct it to automatically load a script to provide an interface for the CD. Make a directory called "scripts" on the CD to keep our sciprts in, and a gui called "start.gui". The Autorun.inf file would contain the following: |
| [autorun] open=Gui4Cli.exe -instance CD_INST "HOME:scripts/start.gui" icon=CD.ico |
| The -instance CD_INST tells Gui4Cli to
start up as a new instance. This is done to ensure that the "Home:" assignment
is the path to the CD, so we can find the scripts. The command line will startup
Gui4Cli, runing the "scripts/start.gui". The root of your CD should have the following:
The "start.gui" and the rest of the interface can be anything you want. I had an HTML file displaying the text I wanted and the following gui: |
| G4C CDAUTOPLAY WINDOW 155 118 393 242 "CD Autoplayer" winattr style resize xOnLoad GuiOpen #this xOnClose quit // This browser will show our welcoming text.. XBROWSER 5 5 383 189 :AutoStart.htm attr resize 0022 XBUTTON 278 203 100 30 'Next >>' attr resize 2200 path = $$this.path extract path root root run 'explorer.exe' "$root" quit XBUTTON 173 203 100 30 "Cancel" attr resize 2200 quit |