Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / January 2005



Tip: Looking for answers? Try searching our database.

Programmatically getting System Profile information

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
brooks.todd@gmail.com - 31 Jan 2005 04:48 GMT
Can someone please answer a Mac newbie programming issue?

I would like to be able to write an application to programmatically
retrieve a specific subset of the information displayed in the System
Profile.  I initially thought that the Gestalt function would give me
what I want, but it looks like the System Profile has more information
than what can be retrieved via Gestalt.  Am I mistaken? How is the
System Profile populated?  Is it available to developers?
Regards,

todd
David Phillip Oster - 31 Jan 2005 05:18 GMT
> Can someone please answer a Mac newbie programming issue?
>
[quoted text clipped - 4 lines]
> than what can be retrieved via Gestalt.  Am I mistaken? How is the
> System Profile populated?  Is it available to developers?

I don't know from personal experience, but my guess is that some comes
from exploring the file system, some from Gestalt, and some from the
device registry. What are you really trying to do?
brooks.todd@gmail.com - 31 Jan 2005 06:21 GMT
I'm trying to audit the computer.  Thus, get hardware information (most
I can get from Gestalt), networking information (maybe from Gestalt?)
and installed applications (I have no idea how to get this
information).

Are there APIs to read the device registry?  (I'm coming from a Win32
world, so excuse my ignorance)

Regards,

todd
Patrick Machielse - 31 Jan 2005 09:49 GMT
> I'm trying to audit the computer.  Thus, get hardware information (most
> I can get from Gestalt), networking information (maybe from Gestalt?)
[quoted text clipped - 3 lines]
> Are there APIs to read the device registry?  (I'm coming from a Win32
> world, so excuse my ignorance)

There exists a command line version of the System Profiler program that
should be able to give you that information:

   /usr/sbin/system_profiler

patrick
brooks.todd@gmail.com - 31 Jan 2005 17:48 GMT
Does this command line version of System Profiler exist in all versions
of the Mac OS?
Specifically, System 8.1 and forward?

Its man page doesn't specify which versions it exists on and whether
the XML format, the SPX file, is identifical in different versions of
the OS.

I appreciate the information on this command_line version.  Thanks for
any additional info you might have.
Patrick Machielse - 31 Jan 2005 21:45 GMT
> Does this command line version of System Profiler exist in all versions
> of the Mac OS?
> Specifically, System 8.1 and forward?

I really don't know the formal answer to your question. However, since
there really was no such thing as a 'command line' on Mac OS prior to
Mac OS X it is safe to assume that you are out of luck on Classic.
Sorry.

I'm not even sure when the (original) gui version of system profiler was
introduced. That may have been with 8.1, or 8.5. If you'd wan't to
interface with those versions of the program, maybe you could use
AppleScript, but I know next to nothing about AS...

> Its man page doesn't specify which versions it exists on and whether
> the XML format, the SPX file, is identifical in different versions of
> the OS.

I _believe_ the xml export was added in OS 10.2 or 10.3. I'm really not
sure, but System Profiler is under (somewhat) active development, so
things do change.

patrick
brooks.todd@gmail.com - 31 Jan 2005 22:33 GMT
I didn't realize the command prompt was something new to Mac OS, though
it makes sense.

I hadn't looked into Applescript as I was planning on doing development
via gcc or possibly even REALbasic since it can make standalone
executables for 8.1 and later.  I guess I'll investigate Applescript.

Not coming from the Mac world, I assumed (probably incorrectly) that
Applescript was analogous to VBScript on Win32 and thus wouldn't be
able to produce executables.
Thank you very much for your time and information!

Regards,

todd
Miro Jurisic - 31 Jan 2005 22:37 GMT
> I would like to be able to write an application to programmatically
> retrieve a specific subset of the information displayed in the System
[quoted text clipped - 3 lines]
> System Profile populated?  Is it available to developers?
> Regards,

Either use Apple Script to get the information from System Profiler application,
or execute the system_profiler command line tool from your application. If the
latter, use the -xml option to make sure that you can parse the output.

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.