Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Packaging HTML on a CD

Posted on 2011-10-27
18
Medium Priority
?
277 Views
Last Modified: 2012-05-12
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?

0
Comment
Question by:Cornelia Yoder
  • 9
  • 7
  • 2
18 Comments
 
LVL 33

Expert Comment

by:Paul Sauvé
ID: 37039425
Perhaps this may help: AutoRun Wizard.
0
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37039488
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
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37039561
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37039567
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
 
LVL 33

Expert Comment

by:Paul Sauvé
ID: 37039624
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
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37039686
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
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37040017
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
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37040083
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
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37040135
I'm fine with anything that creates the directory, copies the files, puts an icon on the desktop, and says "Done".
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37040270
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
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37041136
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
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 2000 total points
ID: 37042383
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
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37042399
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
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37042416
Yep. It's automatically on any standard Windows machine.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37042422
Oh, and you can add something like
MsgBox "Installation complete"
at the end to get the "tell the user it's done" feature
0
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37042475
Awesome!  Thank you so much for the help!  
0
 
LVL 27

Author Comment

by:Cornelia Yoder
ID: 37042702
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
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 37044516
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question