Two Laptop Bag
The moose likes Linux / UNIX and the fly likes CD Auto Run in Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "CD Auto Run in Linux" Watch "CD Auto Run in Linux" New topic

CD Auto Run in Linux

venkat paruchuri

Joined: Aug 15, 2001
Posts: 28
I have developed a swing application and made EXE using a thrid party software. I wrote autorun.ini file to extract my EXE automatically when CD is inserted into the CD Drive. The code to accomplish is
SHELL\CDStart=Start MyApp Setup
This particular code is working fine for windows OS.
Now I have created EXE of my application for Linux platform and has problem with auto extracting the EXE, like any other software for windows, when CD is inserted into CD drive. Is it possible to extract EXE automatically in Linux? I appreciate if anybody can help me out to fix this problem? Looking forward for immediate help..
thank you everybody
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Well, not in the literal sense, since files ending with ".EXE" are supposed to be DOS/Windows/OS/2 executables. Linux executables rarely have extensions.
However, in the wider sense, the answer is - sometimes.
If you're running Red Hat V7 or later with a GUI desktop such as Gnome or KDE the desktop will detect the insertion of a CD and automatically mount it, then look for a file named "autorun", which is usually a shell script. If the autorun file is found, it will be executed.
However if there's no GUI desktop, the CD will neither automount nor execute (which it can't, since it's not mounted).
So, in many popular cases, yes you can do what Windows, but it won't work everywhere and everytime.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: CD Auto Run in Linux
It's not a secret anymore!