Packaging HTML on a CD

I have an application written entirely in HTML which I want to package on a CD with an autorun.inf and an install program.  The install only needs to create a directory and copy the html files to it, plus make a desktop icon to start the first HTML script.  (Plus an uninstall that deletes everything).

I know about the VB Package and Deployment Wizard, but since I am not using any database or VB programs, I don't know if this is the right approach or not, and since I don't even know VB, I'd rather use something very simple.

I also would want it to install on PC or MAC.

What would be the best method to do this simple autorun install from a CD?

LVL 27
Cornelia YoderArtistAsked:
Who is Participating?
 
TommySzalapskiCommented:
Here's something to get you started. Create a text file and rename it with a .vbs extension. Then refer to that file in the .inf.

Disclaimer: I'm not the best .vbs programmer out there. I Googled for most of this code. You're probably better off opening new questions in the vbscript zone if you want to add any features to this.
Option Explicit 'This tells it to force you do declare all variables and is good to have

'Declare the variables
Dim foldername
Dim shell, fso
Dim progfiles, userDesktop
Dim srcPath, destPath
Dim response

'Change these. Leave the \ at the end
srcPath = "D:\Path of all html files on the disk\"
destPath = "C:\YourProgramName\"
shortcutName = "D:\Path of the shortcut\YourShortcut.lnk"

'This one is for shell commands and environment variables
Set shell = CreateObject( "WScript.Shell" )

'This one is for working directly with the file system
Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FolderExists(destPath) Then
  '1 is for OkayCancel buttons, 32 is for warning icon see: http://www.w3schools.com/vbscript/func_msgbox.asp
  response = MsgBox("Folder exists, overwrite?", 1+32, "Warning")
  'response is 1 if they hit "OK" and 2 for "Cancel"
Else
  response = 1 'If the folder doesn't exist, it's like they hit "OK"
  fso.CreateFolder destPath
End If

userDesktop = shell.ExpandEnvironmentStrings("%UserProfile%") & "\Desktop\"

If response = 1 Then 'If they clicked "yes" or if the folders did not already exist
  fso.CopyFile srcPath & "*.*", destPath, true 'copy everything, true to overwrite if needed
  fso.CopyFile shortcutName, userDesktop, true
End If

Open in new window

0
 
Paul SauvéRetiredCommented:
Perhaps this may help: AutoRun Wizard.
0
 
Cornelia YoderArtistAuthor Commented:
Thanks Paul, but I know how to create an autorun.inf.   What I don't know how to do is create the install/setup.exe program that it runs.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
TommySzalapskiCommented:
If you want it to be really simple, you could have the autorun.inf file point to a .bat file (batch script) that copies everything. Or you could just write a setup.exe program in any language. If you want the icon to appear on the user's desktop you can just move it to the %userprofile%\desktop folder. Just create the shortcut and then put it on the CD.
0
 
TommySzalapskiCommented:
All you need to do is pick your favorite language and then look up the methods for calling the commands for checking if a folder exists and moving files.
0
 
Paul SauvéRetiredCommented:
Hav you tried this?

Create the install/setup.exe program, put it in a CD and start it automatically using an autorun.inf file.
0
 
TommySzalapskiCommented:
Paul,
Um, she knows how to do that part. That's what she just said.

Cornelia,
What languages are you familiar with that create executable files? Do you have a compiler for any language? The setup program will be fairly simple so you could do it with anything. How professional does it need to look?
0
 
Cornelia YoderArtistAuthor Commented:
Tommy, the answer is no I don't.  I am a programmer, but I have never used Basic or C, these days I work mostly in php.  So if I understand most of this, I need to write a program in something like Basic that "calls commands" to do this directory creation and copy of the files to that directory.  What are these "commands", some type of windows thingy?  Are they the same on a MAC?
0
 
TommySzalapskiCommented:
They are not even close to the same on a MAC. The idea is the same that all you'll need to do is make a few system calls, but the commands are all different and the format of the exe file is different as well. You will need to write and compile each .exe separately depending on the target operating system.

Now the question is how you want it to look. Do you want it to look like a normal setup application with windows and buttons and all that (Windows Forms or some other GUI) or are you okay with a couple pop-up windows (VBScript) or a text based console/shell window (batch script/shell script)?
0
 
Cornelia YoderArtistAuthor Commented:
I'm fine with anything that creates the directory, copies the files, puts an icon on the desktop, and says "Done".
0
 
TommySzalapskiCommented:
Doing it in vbscript (for the Windows CD) would be my recommendation since you wouldn't need to get any special kind of compiler and all you are doing is copying files.
You can have little pop-ups showing the user what's going on and even ask if they want to overwrite the directory if it already exists. You can get an admin to add the vbscript zone or I can whip something together later tonight (or both).
Just make sure whoever helps you uses things like %userprofile%\desktop not C:\documents and settings\%username%\desktop.
0
 
Cornelia YoderArtistAuthor Commented:
Tommy, that would be great.  An example to get me started would help immensely, along with a little info about where to find documentation on the "commands" you mentioned.
0
 
Cornelia YoderArtistAuthor Commented:
That's great!  Thanks so much :)

One last question ... is vbs something that I have automatically on my computer (Win 7), or do I need to download it somewhere, or buy it?
0
 
TommySzalapskiCommented:
Yep. It's automatically on any standard Windows machine.
0
 
TommySzalapskiCommented:
Oh, and you can add something like
MsgBox "Installation complete"
at the end to get the "tell the user it's done" feature
0
 
Cornelia YoderArtistAuthor Commented:
Awesome!  Thank you so much for the help!  
0
 
Cornelia YoderArtistAuthor Commented:
OK, I give up.  Where on my Win 7 system is VB?  I have hunted and searched and tried all the help files, and I can't figure out how to start it.
0
 
TommySzalapskiCommented:
You just create a text file in notepad or something and change the extension from .txt to .vbs
Then you double click it to run.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.