1

I'm making a program that gets information from a database and puts in a grid in an agenda-like way. What I want my user to do during the installation of that program, is logging in (which is checked through a database) and that the program remembers who installed the program so that the program only gets the information relevant to that user.

The user logs in with an 9-digit number and a text+number password.

Any one who has an idea if it is even possible to do such a thing?

If not, suggestions of alternatives are welcome.

2
  • Don't you want to perform a login at each start of your application instead of at the installation? Commented Dec 13, 2011 at 11:09
  • In this case I don't, because I'm 100% sure it will be used by 1 unique person per install. So when I let the program ask for a login everytime it starts up, it will bother the user. And because this solution is possible, I want to try and make that. Commented Dec 13, 2011 at 12:00

1 Answer 1

3

You could probably do this using a custom installer - but I've found that building installers for .Net is a bit of an obscure process. Microsoft's guidance is here. I'd have the installer be as dumb as possible - just install the app, basically. The installer should be able to deploy your local database - depending on which engine you're using - and set up an app.config file to allow you to connect. I'd have all the smart stuff happen in the app itself.

I'd recommend writing this logic as an "initialize" step in your application - that way, you can offer it as an option for multiple users on the same machine, or in the case of catastrophic failure.

At startup of your app, you need to check for the presence of a database connection; if that's not there, offer the user the "setup database" screen. If you can connect, but the database hasn't yet been initialized - e.g. the dates in the agenda aren't there yet - have a separate initialisation step.

I'd use one of the "wizard" frameworks to make the process as easy as it can possibly be.

The benefit of doing this within the main app, rather than the installer, is that you have the full power of C# at your disposal, and you can test it in the context of your app, rather than within the installer script.

Sign up to request clarification or add additional context in comments.

2 Comments

I don't really get it, but that is my inexperience with building setups. Could you make an example of some sort so that I can understand it?
I will make a login within the program itself afterall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.