I take this from your mention of ClickOnce that it is not an ASP.NET application. Please correct me if I am wrong and edit your question.
I was able to create a simple installer using simple applications. I requested the server name and database name as separate parameters. In fact, in one setup, I was able to request a server name with one request form, Windows and SQL Server authentication using the switch for a second, then the user and password on the third if the "SQL Server" button was clicked. I passed the resulting values ββas parameters to the small Installer class, which created the connection string from the individual parts.
In this particular case, I used the connection string right away to execute some SQL scripts, but you could just as easily save the connection string in app.config so that the program can be used later.
Another option, at least for a GUI program, is the settings dialog box, which can set the connection string and prompt the user to install it when it is not installed. It will not be installed the first time you start the program, so you can wait until the first time or run the program after installing it, request the necessary settings, and then simply install them and exit. This has the advantage of a better user interface and code reuse.
source share