Create config file in Visual studio installer
-
Hi Guys, Application is almost done and now I'm trying to write the installer. Problem is I'm using an XML file for some of the configuration and I can't find how to create one using the installer. Is there something built into visual studio that can do this or will I have to write create some sort of post-install script?
-
Hi Guys, Application is almost done and now I'm trying to write the installer. Problem is I'm using an XML file for some of the configuration and I can't find how to create one using the installer. Is there something built into visual studio that can do this or will I have to write create some sort of post-install script?
If you include the xml file in your Application project (e.g. the C# exe project), then set it's Build Action to Content (select the file in the Solution explorer and then look at the Properties window). Then in your installer you can include the "Content Files" from your project. The files will then be copied to the install directory.
Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com
-
If you include the xml file in your Application project (e.g. the C# exe project), then set it's Build Action to Content (select the file in the Solution explorer and then look at the Properties window). Then in your installer you can include the "Content Files" from your project. The files will then be copied to the install directory.
Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com
Thanks Tom, but how do I modify the file during the install process? It's going to include some database strings, and other application/user specific settings. We normally have a wizard that runs on the first instance of the website that takes care of this. For security we have removed this and want it done during the install. (The old method wasn't perfect, but as a web developer, it worked for me) Regards. Joe
-
Thanks Tom, but how do I modify the file during the install process? It's going to include some database strings, and other application/user specific settings. We normally have a wizard that runs on the first instance of the website that takes care of this. For security we have removed this and want it done during the install. (The old method wasn't perfect, but as a web developer, it worked for me) Regards. Joe
If you want to create a config file during the install process, then I would use a Custom Action[^]. Here's an example[^] that creates a database. This blog entry[^] may help if you are deploying a web project. This blog entry[^] may help you if you need to troubleshoot an issue with your Custom Action.
Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com