Config Wizard

Is there any way to create a Configuration wizard to set up a program the first time it is run? I would prefer a tut or something if it is available but I could not find one. The best example of what i am looking for comes from Azureus when you first run it or if you go to the Azureus menu and select Configuration Wizard. I know that Azureus is written in Java but is there a way to do this with Cocoa?


Thanks

Tom Johnson

iBook G4, Mac Mini, Mac OS X (10.4.6)

Posted on Jul 12, 2007 3:20 PM

Reply
2 replies

Jul 12, 2007 7:48 PM in response to blkbird

Sure. This can certainly be done in Cocoa.

But if your question is if there is some sort of "built-in" wizard in Cocoa then no. You'll have to built the user interface for the wizard yourself... and hook it into your app.

You probably want to take a look at the NSUserDefaults class and also the User Defaults Programming Topics.

Generally user preferences (or configuration info) will get stored in the user's home folder - in a property list file in their ~/Library/Preferences folder. You should provide "reasonable" default values for any pref values that you can. These can initially be built into your Cocoa app's bundle (probably in the bundle's Resources folder).

So, on your very first launch the user will not have a preference file in his home folder. Your app can pull the "reasonable" default values out of it's own bundle and write them to the user's preference file in his ~/Library/Preferences. If there are settings that absolutely cannot be pre-set to some "reasonable" value (ie can not be pre-included in your application bundle)... then you'll need to present the user with some UI so they can enter the correct information. Then whatever they enter would also get stored in their prefs file.

Then on subsequent launches your app will find a preference file in the user's home folder and will be able to get it's configuration info from there.

The references above will give you info on reading/writing settings but you'll have to build to logic that determines whether or not you need to ask the user for specific pieces of information. And you'll need to build the windows or dialogs that you display to the user for obtaining the information your app needs.

Steve

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Config Wizard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.