Getting the computer's serial number

Hi. I want to fetch computer's serial number. For this i m using the following code in cocoa objective c.
This is using a carbon API. so i have included the following lines in my code
#import <Carbon/Carbon.h>
#import <SystemConfiguration/SystemConfiguration.h>
+ (NSString *)computerSerialNumber
machportt masterPort;
kernreturnt kr = noErr;
ioregistry_entryt entry;
CFTypeRef prop;
CFTypeID propID;
NSString* str = nil;
kr = IOMasterPort (MACHPORTNULL, &masterPort);
if( kr != noErr )
goto cleanup;
entry = IORegistryGetRootEntry ( masterPort );
if( entry == MACHPORTNULL )
goto cleanup;
prop = IORegistryEntrySearchCFProperty (entry, kIODeviceTreePlane, CFSTR("serial-number"), nil, kIORegistryIterateRecursively);
if( prop == nil )
goto cleanup;
propID = CFGetTypeID( prop );
if( propID != CFDataGetTypeID() )
goto cleanup;
const char* buf = [(NSData*)prop bytes];
int len = [(NSData*)prop length],
x;
char secondPart[256];
char firstPart[256];
char* currStr = secondPart; // Version number starts with second part, then NULLs, then first part.
int y = 0;
for( x = 0; x < len; x++ )
if( buf[x] > 0 && (y < 255) )
currStr[y++] = buf[x];
else if( currStr == secondPart )
currStr[y] = 0; // Terminate string.
currStr = firstPart;
y = 0;
currStr[y] = 0; // Terminate string.
str = [NSString stringWithFormat: @"%s%s", firstPart, secondPart];
cleanup:
machportdeallocate( machtaskself(), masterPort );
return str;
But it is generating following errors for the lines which i have shown underline to that words in the above code
"_IORegistryEntrySearchCFProperty", referenced from:
"_IOMasterPort", referenced from:
"_IORegistryGetRootEntry", referenced from:

Did you add IOKit.framework to your project under Frameworks?

Similar Messages

  • URGENT!!!! get the same message "serial number not valid for this product" and I am RE installing on the same computer that crashed last week...

    I am attempting to RE install PSElements 11 on a computer where it WAS last week but had a hard drive crash. The message is wrong and the serial number is correct. URGENT as I am at the apple store trying to get help from apple people, and they DON'T want me to install a new version of Yosemite as it will make computer slower...

    Error "The serial number is not valid for this product" | Creative Suite
    http://helpx.adobe.com/creative-suite/kb/error-serial-number-valid-product.html

  • I did the Acrobat Standard subscription (one-year), and each time I try to open a PDF file, I get the "provide a serial number." What am I to do?

    I did the subscription 3 days ago and got an order number confirmation...but I can't open any PDF files on my computer. If there is something I am supposed to download...I can't find the link anywhere.

    Uninstall Reader. Use the Microsoft Installer Cleanup Tool. They try re-installing Reader 9.2

  • I have a new computer running os10.9. my old computer ran cs5.5(upgrade version). I am trying to get CS5.5onto my new computer. when i load cs5.5 towards the end of the install it asks for the cs5.5 serial number. i put that in and everything is accepted

    I have a new computer running os10.9. my old computer ran cs5.5(upgrade version). I am trying to get CS5.5onto my new computer. when i load cs5.5 towards the end of the install it asks for the cs5.5 serial number. i put that in and everything is accepted but then it asks for a serial number for a full version of a product which men is design premium cs3 but it doesn't give me that product as a choice from the drop down menu. it only gives me adobe master collection cs3. why when i have purchased all these different upgrades can i now not use them and how can i sort this out. i need cs5.5 on my new computer.

    Contact Adobe support:
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • Had to have my computer wiped clean due to virus infection. In trying to install acrobat 9, i get a message invalid serial number, even though it is the serial number in my account. What to do?

    Had to have my computer wiped clean due to virus infection. In trying to re-install acrobat 9, i get a message "invalid serial number", even though it is the serial number in my account. What to do?

    there is a lot of info at that link.  by checking that link you'll see that serial number only works for the exact product for which it was purchased.
    ie, if you purchase acrobat 9 std, you need to use acrobat 9 std installation files, not acrobat 9 pro.
    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5.5, 5 | 1
    Contribute:  CS5 | CS4, CS3 | 3,2
    FrameMaker:  12, 11, 10, 9, 8, 7.2
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • I am changing laptops and have tried to download and install Acobat 9 Standard from the Adobe website, but get message that my serial number is invalid. I log in and double check my account and it shows as a valid serial number.  Now what?

    I am changing laptops and have tried to download and install Acrobat 9 Standard from the Adobe website, but get message that my serial number is invalid. I log in and double check my account and it shows as a valid serial number.  Now what?

    If you had it on a laptop that crashed and you threw away, it is still considered as activated on that machine.  YOu should contact Adobe by chat or by phone and have them deactivate for you.
    Here is a link to a page with options to help make contact:
    http://www.adobe.com/support/download-install/supportinfo/
    If you are getting a message that indicates the serial number is not valid, you should look thru the following:
    Error "The serial number is not valid for this product" | Creative Suite
    http://helpx.adobe.com/creative-suite/kb/error-serial-number-valid-product.html

  • I have CS2 with the discs and serial number. After needing to have my computer wiped, reloading the discs, and imputing the serial number, neither phone activation or on-line activation works. What do I do? Lanny

    I have CS2 with the discs and serial number. After needing to have my computer wiped, reloading the discs, and imputing the serial number, neither phone activation or on-line activation works. What do I do? Lanny

    Adobe took down the CS and CS2 activation servers, but they put up a version of CS2 for those who previously had a license to it.
    You will need to download the software from here, and use the serial number given on these pages. Follow the directions on this link, and you will soon be up and running again.
    Error: "Activation Server Unavailable" | CS2, Acrobat 7, Audition 3

  • I cannot locate the 24 digit serial number to install my Adobe photoshop elements 12 on my Mac computer. Any help is appreciated!

    I recently purchased the Adobe photoshop elements 12 and cannot install on my Mac desktop since I cannot locate the 24 digit serial number.  All the numbers on the back of the box are not 24 digits. Please help! Thanks!

    Find your serial number quickly

  • Help! When I try to reinstall CS6 Design and Web Prem i get message that my serial number is invalid

    When I try to reinstall CS6 Design and Web Prem i get message that my serial number (Design and Web Prem <serial number removed>) is not valid? Why???? I have it installed now on just one computer only. It was installed also on a computer and a laptop. The laptop crashed and couldn't restart anymore. I had to through it away. After that I installed on another computer at a place where I work sometimes with photoshop. Then suddenly I got message at my computer home that the serialnumber is invalid. I installed for the time an try out version, and now I have deleted the version that I had on the computer but when i want to reinstall my legal bought version with the serial number that i mention there, I get again the message that my serial number is invalid. But now it is only installed on 1 other computer. If I check the sites, I have to contact Adobe but I don't know how. The link does not work and I cannot find any phonenumber.!!

    If you had it on a laptop that crashed and you threw away, it is still considered as activated on that machine.  YOu should contact Adobe by chat or by phone and have them deactivate for you.
    Here is a link to a page with options to help make contact:
    http://www.adobe.com/support/download-install/supportinfo/
    If you are getting a message that indicates the serial number is not valid, you should look thru the following:
    Error "The serial number is not valid for this product" | Creative Suite
    http://helpx.adobe.com/creative-suite/kb/error-serial-number-valid-product.html

  • SCCM issue - "LANG_LIST has some locales which does not match with the locale of serial number"

    I have a problem with the error "LANG_LIST has some locales which does not match with the locale of serial number" recurring.
    I am trying to install Acrobat XI Std silently by SCCM.
    I've used the Adobe Customisation Wizard to create a mst which include the volume serial number we have with our licence purchases. Note that I am in Australia. I use the command line in SCCM for the install as "msiexec /i "AcroStan.msi" TRANSFORMS="D&B_AcroStd.mst" /qn" which fails silently. If I install on a local machine using an admin command prompt and changing to /qb at the end, I get the aforementioned error.
    I have a few things to try and resolve, having searched the adobe forums and other forums for the solution. The mst is only trying to install US English & I have even gone so far as to use the direct editor in the customisation wizard and change some values in the property table to resolve this. In the property table I can confirm that LANG_SEL_DEFAULT = ENU, REGIONAL_LIST = ENU, LANG_LIST = en_US, ProductLanguage = 1033
    Is there a way to check the language specified for ym serial number?
    Bryndon

    Update on a couple of details:
    @Sabian,
    Thanks for the location, I've downloaded and then when I tried an install of the newly extracted msi (admittedly on the same computer) I got exactly the same issue. Of note though is that running /qf automatically brought up the same serial number and the same incorrectly spelled company name. Installing on another computer (freshly imaged) doesn't have those inputs already present under /qf. Next when I try using the transfrom (a new one) with /qr it gives an error of the serial number, displaying the entire serial.
    @Sebastian
    I've had a look through yours and it seems our issues could have the same origin. Looks like I may have to call customer support regarding the serial number as Sabian suggested in your thread.
    The bit that gets me is when the same serial number is used in a manual install (or /qf) then it installs ok without any errors.

  • I would like to purchase the license and serial number for Lightroom 4

    I would like to purchase the license and serial number for Lightroom 4 however even though you can download it from this site, there is no option to buy.  Unfortunately I can't upgrade my computer's operating system beyond OSX 10.6.8 even though it's an intel duo so there's no point me getting Lightroom 5. 
    There doesn't seem to be an option to contact anyone at Adobe to see if there is an option to buy.  Each time I attempt to do so I am directed to the forum, so it looks like my only option may be to use another app.  Maybe capture one's the way forward

    Adobe does not sell Lightroom 4 any longer.

  • I have a new ipad.  I can't get support without my serial number.  Ipad won't turn on.  I ordered it from Target so I have no receipt.  I can't get telephone help without serial number.  What to do?

    I have a new ipad.  I can't get telephone support without my serial number.  The ipad won't turn on.  I order it from Target and there is no serial number on the invoice.  How can I get telephone help without serial number?  Please help!

    The Serial Number is on the back of your iPad.

  • Desactive the option "create serial number automatically"

    Hello
    I´am using serial numbers for certain materials with Stock check, and in my serial number profile the procedure MMSL (maintain goods receipt and issue doc.) is set the serusage 03 (obligatory).
    I need this configuration, so I can control stock for which serial number, and this serial number can´t be set automatically, it was to be write down by the users.
    The problem I have is that when I´am doing a material movement, for example, mvt 501 in MB1C or in MI04 to register the inventory count, the series number is obligatory has I want, but the system gives the user to "create automatically serial numbers", and when the user do that is creating new serial numbers sequential by the number range I gave. What I Want to know is:
    Is there any way to disable this option of "create serial numbers automatically???
    Thank you very much for your help
    Best Regards
    Carla

    MAHA REDDY wrote:
    Hi All,
    I am trying to generate the serial no on the form by this coding
    i have taken non data base field SI_NO
    IF :system.record_status IN ( 'NEW' ,'INSERT' ) THEN
    :XXEAM_JOB_TEMPLATE_LINES.SI_NO := :System.CURSOR_RECORD ;
    END IF ;
    If I am deleteting a record from the middle of the record the sequence on the serial number does not gets changed eg. if there r 5 records if I delete 3 record then the sequence of serial number will become 1,2,4,5 where as it should become 1,2,3,4
    same is the issue if I add a record in the middle the serial number gets duplicate eg if there r 5 record and i am adding another record after 2 then its coming like this 1,2,3,3,4,5 where as it should come like this 1,2,3,4,5,6
    Hi Maha,
    You can use PRE-RECORD trigger at block level and if you write
    :TXT_SL:=:system.trigger_record;you will get serial no. After deleting or adding it will not re-organize your serial no un till you navigate at other record. If you navigate through out the record, it will
    re-organized.
    If you want it dynamically, you need to do a loop after any interaction in records.
    Hope understand..
    Hamid

  • HT4972 i got my new iphone 4s , can not download the OS 5 it says error 9006 on my windows 7. also the phone does not show the capacity and serial number details on the itunes summery ?? please help

    i got my new iphone 4s , can not download the OS 5 it says error 9006 on my windows 7. also the phone does not show the capacity and serial number details on the itunes summery ?? please help

    Hi Kevin,
    The iPhone 4S comes automatically loaded with iOS 5, and any updates after iOS 5.0 can be completed directly from on the phone in Settings > General > Software Update. If you are having trouble using iTunes to update software, I suggest you reset iTunes so that you can pair your phone to the computer again, because if you can't see the serial number and capacity, that generally means your phone isn't paired.  For any problems this doesn't fix, please contact Apple directly through their automated help line, 1(800)MYAPPLE.

  • Getting Light Room 4 Serial Number logged in to start

    I purchase Adobe Light Room 4 several months ago and loaded the software on my iMac.  I just tried to get started and was unable to get acceptance of my serial number.  My serial number is an 18 character string.  My serial number has a bar code under it.  There is also an ID PN and is followed by 8 numbers.  I also tried submitting that ID and still didn't get the next button to light up. I noticed that the serial number format for Adobe LightRoom4 for signing in was 24 characters.  What am I doing wrong?

     

Maybe you are looking for