Over the years I have created numerous Windows Forms Applications for a variety of purposes. Normally this is for my own use or for use by an IT team but on a recent project I was developing a Windows Forms Application which is to be used by regular Joe Blogs end users. This meant I needed to provide an installer to ensure all the prerequisites were installed i.e. .Net framework, etc. While it is not something I have had to do a lot of I have created a few installers in my time, however most of them have used the OOTB Setup Project template from Visual Studio.
On this project I am still using the OOTB Setup Project, however I have also had to capture some additional parameters during the installation such as the URL of the web service to connect to. I knew this would be possible but I had no idea what would be involved but after some research I was able to find an excellent MSDN article on Using a Custom Action to Display a Message at Installation. While the idea is slightly different the principle is the same and you can easily adjust this. In my case I capture the web service URL and update the settings file with the URL supplied. I found a good article which details the steps required to update the configuration file. My code is slightly different in that it is within the custom installer class so I have included this below as well.