Author Topic: autoruns  (Read 2295 times)

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
  • ChameleonMan Progress: DONE!
    • MSN Messenger - billybob884@hotmail.com
    • AOL Instant Messenger - billybob884
    • View Profile
    • Email
autoruns
« on: 2006-02-08, 02:53:59 PM »
does anyone know how to make an autorun script for cds? like i want to have the game quto-install when someone puts it in

and btw, when you make an installer, does it include the vb runtime files?
-- Mike "billybob884" McDermott

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: autoruns
« Reply #1 on: 2006-02-08, 03:13:03 PM »
I believe all the neccessary files are supplied when creating an installation using NSIS, but I'm not sure, so I'll leave that question to somebody else.

As for the auto-run, it's quite simple.  Create a file called "autorun.inf".  In this file, enter three lines:

[autorun]
open=File.exe
icon=MyIcon.ico


where File.exe is the file you want to run (you can give the path to the file if it's in a subdirectory: "open=\Install\File.exe")
and MyIcon.ico is the icon you want to use.  You can specify the same icon as the file like this: "icon=File.exe,1" where 1 is the index of the icon stored within the file (it may be 0-based, I'm not sure).

You can add more lines to add more options when right-clicking on the CD icon like this:

[autorun]
open=File.exe
icon=MyIcon.ico
shell\install = &Install
shell\install\command = install.exe


where the &Install specifies the text that you want in the menu (the & is placed before the "hotkey", i.e. the key you can press on your keyboard to access that menu item directly when the menu has focus rather than clicking on it.  Looks like this: Install
And install.exe is the program that runs when it is selected.

There are other things you can do with this file, such as machine-specific auto-runs, but that's probably not necessary for you.  If you want to know more, take a look here: http://autorun.moonvalley.com/autoruninf.htm

Mostly, however, you'll probably just have a simple one (most CDs do) like the first one above.

Then, when you have the autorun.inf file, place it in the root directory of your CD, and that's it.
Edward Dassmesser

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: autoruns
« Reply #2 on: 2006-02-08, 03:15:46 PM »
Oh, and on a side note, this only works if a computer's CD auto-run is turned on (which is default, I believe).  If it's off, then the menu items will still be there (Autorun, Install, etc) and it will automatically run the program when you double-click on the CD icon, but won't run automatically when the CD is put into the drive.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: autoruns
« Reply #3 on: 2006-02-08, 07:17:59 PM »
Yes, the VB runtime files are included in the installers created from the NSI scripts created from the package and deployment wizard.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
  • ChameleonMan Progress: DONE!
    • MSN Messenger - billybob884@hotmail.com
    • AOL Instant Messenger - billybob884
    • View Profile
    • Email
Re: autoruns
« Reply #4 on: 2006-02-09, 02:59:57 PM »
simple enough, ill give this a try tonight, im going to burn the final compilation
-- Mike "billybob884" McDermott

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy