asp.net application install folder
Disclaimer: this is not a question about how to install asp.net or an application using it!
Hi!
I am pretty sure many of you have once installed some kind of forum, blog or CMS (mostly PHP powered applications). All of these contain a folder mostly named "install" where (after you copied the files to t开发者_如何学编程he webserver) point your browser to to complete the installation by entering for example database information (servername, username, password, ...). After that, most applications suggest that you delete this folder or at least change the permissions so nobody from the outside can access it anymore.
Now to my question: how would you go about that in the asp.net world? I don't really like the "install folder"-approach and I thought there might be a different mechanism for .net/IIS. The person installing my application should be able to enter his database information as painless as possible, which should ultimatively be stored in the web.config file.
If it makes a difference, I am using asp.net MVC.
Thanks for your help!
We use an installer program (NSIS) to collect custom values. After the files have been copied to the deployment folder, we run some IIS scripts to create the directories, setup host headers, ports etc, and then we write the web.config using variable substituion with the details the customer supplied in the installer.
Is also creates the databsae and setups up the initial user details based on customer input to the installer.
EDIT:
Check out
http://bloggingabout.net/blogs/dennis/archive/2008/05/16/programmatically-creating-an-iis7-site.aspx
For an exmaple on how to create an IIS site with C#.
精彩评论