General Question

gciochina's avatar

Parameters or Registry keys? Which is best to tell an application to do "something" at startup?

Asked by gciochina (107points) September 4th, 2009

Okay, I’m designing this application.

At some step it needs to reset the computer, run at startup and do some work. But the problem is that i need to save some “flags” from the first run, so when running at startup the app will run based on those flags? Should i save the flag states in the registry or should i just give them as parameters in the startup shortcut?

Thanks!

Observing members: 0 Composing members: 0

3 Answers

jasonjackson's avatar

The registry is probably the better choice.

That’s where “configuration”-type stuff is supposed to go, for one thing, so people are more likely to look for it there. For another, users will sometimes create their own shortcuts to an application, and we don’t necessarily want to have to deal with maintaining some set of flags in order to do so.

(Depending on exactly what you’re trying to accomplish, it might be nice to build in some command-line parameters too, in case power users would want to utilize them..)

gciochina's avatar

Yea, registers were my first option also. Thanks for confirmation AND for the detailed explanation ;)

Thumbs up!

Babbage's avatar

The registry is a good place to keep your configuration information, but you may also want to consider using configuration files (such as INI or xml). Using an xml file, you have the potential for making a ‘portable’ version of your app (if you are ever inclined to do so), plus if you ever have any inkling to port your program to another operating system (such as Linux), you wouldn’t have to muck around with changing registry code to configuration file.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther