 |
 |
Implementing product registration
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status:
Offline
|
|
I've seen an example of this on Cocoa Dev Central, but it wasn't as certain as I'm aiming for. Is there any way to get a computer's MAC address and the user's name in Cocoa?
Any good tutorials on the subject?
Also, how do I ensure that a certain method is implemented when a window's entire heirarchy has been AwakeFromNibed? I'd like to run an alertSheet right after the program launches (as I've seen done many times), but don't know where to put it so that it runs at the right time (that is, after everything else has loaded).
|
|
you are not your signature
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2001
Status:
Offline
|
|
For the MAC address, check out SystemConfiguration.framework. For the user name, just use NSUserName() (No arguments, returns NS/CFString). However, actually using these in a registration scheme is like sending an open invitation to crackers.
As for the awakeFromNib thing, just do it when the window and associated sheet have been "awoken". If you really want to be that anal about it (most windows aren't actually "awoken" until they are made visible, I don't think), you'll have to keep track of them all with an NSDictionary.
|
|
"Think Different. Like The Rest Of Us."
iBook G4/1.2GHz | 1.25GB | 60GB | Mac OS X 10.4.2
Athlon XP 2500+/1.83GHz | 1GB PC3200 | 120GB | Windows XP
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status:
Offline
|
|
Thanks Mike. That's more help than the apple Developer Site was! But if you shouldn't use those, what should you use?
And for the second, that's still my question: How do I do it when the Window is "awoken"?
Thanks.
|
|
you are not your signature
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Gametes:
And for the second, that's still my question: How do I do it when the Window is "awoken"?
Put it in the window's awakeFromNib method.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2001
Status:
Offline
|
|
Originally posted by Gametes:
Thanks Mike. That's more help than the apple Developer Site was! But if you shouldn't use those, what should you use?
Just use the person's e-mail address to generate the code, and make your registration algorithm really obtuse. I'm no expert on generating registration schemes, but the guys at Unsanity keep a blog where they recently posted some great tips on building one that is hard to crack (read: it'll still be cracked if the app is interesting, but it won't piss off users and it'll take a while).
Originally posted by Gametes:
And for the second, that's still my question: How do I do it when the Window is "awoken"?
The awakeFromNib method is what you want. The question is where to put it. The Cocoa docs state that although awakeFromNib is essentially called in a random order, when it is sent to the owner object of a NIB, you are guaranteed that every IBOutlet that could be connected, is connected. This may actually apply to any object in the NIB, but I'm only positive about the owner object. Therefore if you have a NIB containing nothing but your window, the registration sheet, and a "controller" object set as the owner of the NIB (with outlets for the two windows), you can successfully show your window and display the sheet from the controller object's awakeFromNib method.
Originally posted by Gametes:
Thanks.
You're welcome!
|
|
"Think Different. Like The Rest Of Us."
iBook G4/1.2GHz | 1.25GB | 60GB | Mac OS X 10.4.2
Athlon XP 2500+/1.83GHz | 1GB PC3200 | 120GB | Windows XP
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status:
Offline
|
|
Thanks Mike; I'm currently checking out that blog now, but it seems to me the email address would exhibit the same problem that made me want the MAC address in the first place: once I give out a single code, the purchaser could then just give out their name and code on the internet and it would work for everyone. No, it must be tied to the computer and the user, not just something the user types in.
I had the sheet in AwakeFromNib all along, but even now that I've added a connection from my controller class to the window, still the sheet is appearing before the window does, hanging in midair.
Thanks
|
|
you are not your signature
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
If you're wanting to pop up a panel when the app finished launching, implement -applicationDidFinishLaunching: in your NSApp's delegate, or subscribe to NSApplicationDidFinishLaunchingNotification. There could be times that -awakeFromNib might be called that aren't when your application first launches, and you might not want to put up a panel then.
My $.02 on registration schemes: don't tie it to the hardware Ethernet address. What if I buy your product and then replace my Mac with a new one later? What if I'd like to use it on two machines, but not at the same time, i.e. at home and at work? (Trust me, the "buy two copies" answer doesn't sell many licenses.) What if my machine has multiple NICs, some of which are removable? Be sure to weigh the security against the inconvenience to your users.
Plenty of shareware licenses that are tied to email addresses get sold every day. The nice thing about using the email address is that it's a piece of information someone won't want to give out -- I certainly don't want to get spammed or hacked as the result of letting my personal information float around the pirate community. And if you see a leaked license out there, you can disable it in the next update to your app. No registration scheme is foolproof -- if the pirates want your software badly enough, they will manage to crack it. (Or krax0r it, or whatever those kids do these days.) Your efforts are better spent on making your software a) good enough for someone to want to pay for and b) easy to pay for.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|