I’ve been dabbling in HTML, trying to build a website for my boss – a great Christmas gift, I figure. So far, I’ve learned a lot, and accomplished very little, but hey, I’ve still got ten weeks or so.
So, assuming I’m able to create something brilliant and put it on a CD, how can I make it work so that when my boss inserts the CD into his drive, something will automatically pop up and say “To view Portwest’s Brilliant Website for Mr. Boss, click here” rather than making him search out and click on “index.html”?
So far, I’m doing everything in Notepad, and my level of sophistication is admittedly abysmal. (In other words, please type s-l-o-w-l-y so I can understand.)
Create the web site. Make sure all the links work as intended.
Create the autorun files.
(It’s possible to test these on your hard drive prior to burning to a CD.)
Burn all to the CD.
Test it.
The point is, the creation of the web site you burn to a CD is a separate function of the ability to have that CD, when inserted into a CD player on a computer, actually run the and bring up the web site.
Make sure you burn all the necessary image files too. It’s easy to miss a few, since when you test it, they all show up, because you already have them. I’ve made this mistake emailing small websites to people.
That’s actually two separate problems. If your HTML code is correct, and images are missing from the disk, then they won’t work, even if you have the images on your hard drive. But if the HTML is incorrect, then it may be that the images will show up on your computer (and only on your computer), regardless of what’s on the CD. Some HTML editing software (in particular, the editor that comes with Netscape) likes to turn relative addresses for images (which is almost always how you want to specify addresses) into absolute addresses (which, when you’re creating the webpage, will be on your hard drive).
As an example: You’re storing your work in the directory “c:\webpage” on your hard drive, and you’ve got a subdirectory for all the images for the webpage called “c:\webpage\images”. You create an index.html page, and put a logo image on top of the page. You tell the editor that you want to use the image “images/logo.gif”. This means “Look for the subdirectory called ‘images’ in the current directory, then find the file ‘logo.gif’ in that subdirectory”. A good editor will turn that into the HTML code <img src=“images/logo.gif”>. That way, if you copy everything onto the CD, or onto a webserver, or anywhere, that image will always work, so long as it’s in the right place relative to your index.html page. But Netscape’s editor will instead look at that and say “Hmm, the full path for that image is ‘c:\webpage\images\logo.gif’. I’d better put all of that in.”. So it’ll generate code like <img src=“file://c|/webpage/images/logo.gif”> (I may have the syntax a bit off there, but you get the point). Now, when a browser looks at that page, it’ll look for the file c:\webpage\images\logo.gif on the particular computer you’re using, and if it can’t find it, it won’t work. It won’t even bother looking on the CD. So when you look at the page on your own computer, there’s no indication of a problem (because it can find the file on your computer), but when you or anyone else looks at in on another computer, the image is missing.
Of course, you said you’re using Notepad, so this is all irrelevant, anyway. This is a hard mistake to make, coding manually. But it’s a good warning for anyone using a WYSIWYG editor.
I’m well aware of this. My point was testing the site from your hard drive isn’t enough. It was meant as a warning to the OP to double check all the files so he doesn’t have to waste a CD.
I’ve actually done this before. If you just want to get the autorun file working without learning all about it (and without using AutoRunPro as per Q.E.D.'s link), put this code into a file named autorun.inf in the root folder of your CD:
[autorun]
shellexecute=index.html
icon=calvin.ico
label=Calvin and Hobbes
If you don’t have an icon file, just delete the whole icon= line, and feel free to change the label to whatever is appropriate.
In case anyone is wondering, my autorun file is from an HTML collection of C&H strips.
Note that the link Q.E.D. links to and the example given by Hauky both require that a special executable is also on the CD. “shellexecute.exe” does not exist on everybody’s system, even in the limits of MS-Windows. So you would still need to copy it to the CD. In the world of software (including web pages) don’t assume anything. (And what if he tries it on a Mac?)
Secondly, if your boss is smart*, he will have turned off autoexecute. So you should make sure that he knows how to start the page up by hand.
What’s wrong with having Auto Insert Notification turned on? I have it that way. If I don’t want a CD to autorun, I just hold down the shift key while I insert the disk.
Also if he’s on XP, he needs to be an administraor for the autorun.inf to start.
If he’s on a PC where he is not the admin. it won’t start automagically.