Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Getting MAC Address


4 replies to this topic

Th.M

Th.M
  • Full Members
  • 12 posts

Posted 09 June 2008 - 14:52

Hello,

I display a dialog asking for IP and MAC address. By default, the fields shall display the IP and MAC of first network device. The user can change it if the installation belongs to a different device and just "OK" if only one card is installed.

By forum search I found http://www.installsi.../en/isp_net.htm "Retrieve Local TCP/IP Address" to get the IP.

But how to get the MAC address?

Thanks in advance,
Thomas


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 09 June 2008 - 22:37

Make a Custom Action DLL with code based on:
http://support.microsoft.com/kb/118623

Note that this sample assumes that the NetBIOS / NetBEUI protocol is bound to the NIC.

Th.M

Th.M
  • Full Members
  • 12 posts

Posted 10 June 2008 - 11:43

Just read your replay...
Thanks a lot!

Actually I had also started with the netbios approach, but stuggled with the callback function within the NCB struct.

http://msdn.microsof...897(VS.85).aspx
http://msdn.microsof...902(VS.85).aspx

How to handle CALLBACKs?
Or did I get this wrong :/

Edited by Th.M, 10 June 2008 - 15:03.


m.nouryan

m.nouryan
  • Full Members
  • 23 posts

Posted 17 June 2008 - 19:04

I would suggest using WMI, here is an example:

http://www.codeproje...throuh_WMI.aspx

It's pretty easy and straight forward. WMI is the recommended interface to get system/hardware information.

Regards,
Morteza


Th.M

Th.M
  • Full Members
  • 12 posts

Posted 23 June 2008 - 13:08


Hi Morteza,

sry for replaying that late...
Thank you very much for that information, I'm not completely done with it, but I think it will work this way.

Thanks,
Thomas