We help IT Professionals succeed at work.

CD install command

I need to write a program (probably Visual Basic, but open to suggestions) to install some files from a CD using the autorun.inf method.  I know how to do the autorun, but I don't know how to write the .exe file.

It is very simple function.  I need to create a directory (and subdirectories) if it doesn't exist already, then copy a bunch of files to that directory.  I need to make a desktop icon for the system that points to a particular file in the directory.  I expect I also need an uninstall to delete those files and folders.

I want this to run on MAC or Windows.

Can someone please explain to me what I need to do to accommodate both platforms, and point me to the shell(?) commands to do it?  

I can't believe there isn't a simple tutorial or example of doing this somewhere on the web, but I have not been able to find it.
Comment
Watch Question

AWS System Administrator
BRONZE EXPERT
Commented:
If you write it in VB, then it won't run on a Mac (also, note that MAC is not the same as Mac. Mac is for the computer. Being all caps typically denotes an acronym, and MAC stands for Media Access Control).

The .exe file extension denotes a DOS or Windows executable. OSX, Linux and everything not made by Microsoft does not use this extension. Also, Applications are made for each OS. Executables are tied to the CPU architecture and the Operating system both. Make an executable for Windows, and you cannot run it on OSX. Make something for Mac OSX, and you cannot run it on Windows.

Visual Basic is a Microsoft program, and with the exception of VB1 has only ever compiled applications for Windows (VB1 made DOS programs). Visual Studio programs (which includes VB) does not like producing anything for something other than Windows, by design. If you want something that is like Visual Basic but will produce applications for more than just Windows, I'd recommend REALbasic. RB compiles for Windows, Linux, and OSX. However, you CANNOT make one executable that runs on both Windows and OSX. You have to compile two separate ones.

Also, if you use strictly shell commands, then you'll run into issues there too, since the Windows commandline scripts and commands differ from their counterparts under Unix and Linux (Mac OSX is Unix based).

And in addition, autorun.inf is a Windows only thing.

Long and the short of it, you need to see about making a separate OSX program and a Windows one, with a hybrid CD set with autorun.inf and Autostart. Autostart is a utility in OSX for automatically starting something on a CD.

Author

Commented:
OK, that's good information!  So I need two separate programs, one Autostart that installs on a Mac and one autorun.inf and accompanying .exe that installs on Windows.

The Windows .exe one can be written in VB and will use windows commandline scripts and commands.

The Mac one can be written in (something else) and will use OSX commandline scripts and commands.  I looked for REALBasic but it seems to be a commercial product which is a little expensive for my simple application.  Is there any other choice for a Mac version?

Next, can you point me to a tutorial or manual for each of the "commandline scripts and commands" that I would need to use for Windows in VB and for the Mac?  I will need directory/folder create and delete, file copy and file delete, and however you create a desktop icon.

Keith BrownAWS System Administrator
BRONZE EXPERT
Commented:
Well, it depends on what you want to do. You don't need to do commandline stuff if you're using VB, and may just help to confuse things. What version of VB do you use? Things tend to vary between versions, and some just isn't very compatible with others.

And yes, REALbasic is commercial, however, there is not much you can use to develop for OSX without actually having a Mac. The only other things I can think of recommending would probably be GNUstep, or Lazurus. Correct me if I am wrong, but based on your phraseology, I take it that you're not a Mac user. If you do have a Mac, then things open up drastically, because you have options like XCode (which Apple has as a free download).

Author

Commented:
I just want a program that will run on the CD to copy the files to a user's computer so s/he can run them from a desktop icon.  The files that would be copied are pure HTML, nothing exotic.

I do not have a Mac, but I would be willing to find someone who does long enough to get this set up, if I know exactly what I need to do.

I'm wondering just how hard it is, and if I gave a pseudocode statement of what I needed, would it be a reasonable request for some EE expert to just write the code and send me the compiled autostart file to put on the CD?  (I don't want to post code details here, but I can be reached though the email on  www.corneliayoder.com ).  If so, I'll just open another question requesting that.
Keith BrownAWS System Administrator
BRONZE EXPERT
Commented:
What you want to do, in terms of simply having a program copy files, is very easy to do pretty much in any language.

Now, on the autostart thing, it isn't just a file or something you can easily make, but rather how you burned the CD. Also, I've done some more digging around into it, and the newer MacOS versions don't seem to support it. For security purposes, limit you to just automatically opening a folder. There are two methods for doing this. openup and bless. Both require a mac with OSX. Now I've seen CDs that autostart with finder background images with instructions on what to do (telling the person where to drag and drop stuff or click on the application).

Author

Commented:
I managed to get my hands on a CD with a similar situation, and when I opened the readme file, it said "...For Mac users, drag the folder to your desktop and click on StartHere.html ...".

I guess this is the simplest way and for me the obvious way to go, since I barely understand most of what was in the links you gave me.

I'm very grateful for the work you did looking this all up and helping me sort out the possibilities.  And thanks so much for a really well-done reply to this question -- you've saved me many hours of agony to only to find out that it can't be done as I expected -- and it's an excellent example of how EE is supposed to work.

Cheers,
Cornelia
Keith BrownAWS System Administrator
BRONZE EXPERT

Commented:
Hey, no problem. That's what we're here for.

It kind of sucks that they dropped support for Autostart, and they also did so quietly. Reason I figured it out, was while searching on how exactly to burn the disk with autostart, I saw a forum post where someone was complaining that after they upgraded their version of OSX, that their disks with autostart no longer worked.

Still, it makes sense on why not to do it, since it is something easy to abuse. For a while I was part of a group that made some tools based around the U3 flash drives (which allowed the use of autorun.inf), and that got abused pretty bad. People had things so they could plug in their custom U3 drive, and it would automatically rip out the CD keys for a bunch of different programs that were installed on that computer, as well as do damage to the computer (install viruses and such), all automatically and within seconds of plugging the drive in. The person could walk away with ways to use expensive programs for free, as well as messing up the machine they stole the keys from.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.