Connection string during installation

connectionmsi

I've been convinced to use windows setup files(msi) for the installation of my new windows forms application after I asked a question here and got some excellent answers (thank you all):
.Net Application Deployment

Now i have a different question:

My application will need to access a SQL Server to provide users with data, which means that the connection string must be stored in the client's app.config file.

How should I handle this?

During installation, the user enters the connection string to that database?
How they get the connection string? In an email from the admin?
What if the admin wants to use SQL authentication and need to put the user info at the connection string?

So you know, the app will be sold via the internet, so I don't have any access to the admins or the network.

Any suggestions?

Thanks in advanced.

Best Answer

Consider that the connection information may change at any point in the application's lifespan. Because of this, installation time is not the best location for this to occur.

Most commonly, you'll want to prompt the user for this information at startup if it is not already present, or if it is present but connection/login fails (with an appropriate error message). Upon successful login, store the information in the registry or whichever app config data solution you're using. You may also want to look at encrypting this data for security purposes, if you think that clients will be using per-user authentication.