LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-01-2005, 12:45 PM   #1
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94
Blog Entries: 1

Rep: Reputation: 15
Question How do Autoruns work?


I'm BAAAAAAAACK with a slightly different, easier question:


How does the autorun feature (like on a CD) work? For example: How is it that the CD can autorun in Windows AND in Macintosh?


My guess is that they share some code common to both OSes/CPUs that determines the OS of the system, and executes the corrosponding program.... but WHAT that common code is- thati s what I'm curious about
 
Old 10-01-2005, 12:55 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well it's nothing clever, just looks for the autorun file on the cdrom...
 
Old 10-01-2005, 01:44 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Answering your implicit question:

"Programming Languages" generate "software programs" that generally fall into one of two categories:

1. Interpreted programs:
<= THESE CAN USUALLY BE RUN ON ANY PLATFORM
THAT HAS THE RIGHT INTERPRETER INSTALLED

2. Compiled programs:
<= THESE CAN USUALLY BE RUN ON ONLY ONE SPECIFIC
COMBINATION OF CPU ARCHITECTURE AND OPERATING SYSTEM

"Interpreted programs" are basically "scripts". "Perl" is a great example of an interpreted language: you can write a Perl program on Linux, copy your .pl file to Windows and (unless your Perl script calls some OS-specific feature), the script will run just fine in the new environment.

On Windows, it looks for a (clear-text) "autorun.inf" on the CD's root directory and, if it finds one, will execute whatever program "autorun.inf" says to run.

In general, "autorun.inf" points to a windows-specific .exe, and I would expect it to crash and burn if you tried to run it on a Mac.

But it could just as easily point to a platform-independent interpreted program .
Java would be a good candidate. Using Java would also necessitate putting two copies of the Java runtime on the CD: one copy for Mac, the other for Windows.

But the point is that there are lots and lots of possibilities - the details of each could vary wildly. I honestly don't know how Macs support "autorun" in general, or how your particular CD happens to work.

I point you back to the Wikipedia:
http://en.wikipedia.org/wiki/Interpreted_language

'Hope that helps .. PSM

Last edited by paulsm4; 10-01-2005 at 02:02 PM.
 
Old 10-01-2005, 05:03 PM   #4
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
I always see an autorun file on a CDROM in Windows, I was jus curious if Macintosh uses the same mechanism. As for Linux, I personally haven't found many off-the-shelve programs for it period (except Star Office, which I have but havent put on my Linbox yet) so I'm not sure how many Windows/Linux CDs can autorun on both systems (come to think of it, I should install it on my linbox just for the sake of finding out)



I mean, lotso f CDs I come across can autorun on Windows and Mac, so I was just curious...
 
Old 10-01-2005, 06:03 PM   #5
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I haven't really done much with autorun.inf before myself, but a quick google search turned up this:
http://autorun.moonvalley.com/autoruninf.htm

Sounds like the autorun can specify different binaries to run based on the platform...
 
Old 10-01-2005, 07:55 PM   #6
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Very interesting. I had a feeling it would be something like that. I never really knew or cared what a .ini file was, always thought it was Windows specific. Assuming it is, then it's actually slightly surprising that Windows would allow such flexibility to extend to other OSes. And if it isn't... well... I wonder if theres some sort of standard. highly doubt it, I have a feeling it's a Windows-thing that other OSes picked up on.

I'll look into it
 
Old 10-01-2005, 07:58 PM   #7
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Popped this in my Firefox Address Bar (aka Google's "I'm Feeling Lucky") and got this: http://www.phdcc.com/shellrun/autorun.htm

Well duh! That makes sense- Each OS can have it's own kind of "Autorun" file and it's own way of handling it. the App Programers could have a different autorun for each OS. Assuming 2 or more OSes use an autorun file of the same name, there can be options without that autorun to distinguish different actions for different OSes


makes sense, thanks guys
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
user log in and autoruns script rharris72 Programming 1 11-21-2005 09:14 AM
Nautilus autoruns CDROM MasterPi Linux - Software 0 10-21-2004 01:59 PM
how do you make an cd that autoruns in windows? caged General 2 03-22-2004 09:35 PM
No keyboard when ICA autoruns on RH8.0 bobsv Linux - General 0 02-03-2004 11:34 PM
FALCONS EYE (nethack) FAILS ON STARTUP, use to work, wont work even after reinstall roorings Linux - Software 0 10-08-2003 10:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration