I’ve recently been subcontracted to write an application for a clients’ client. I have to deliver the application in a easy to install fashion, since I won’t be installing the application myself.
The problem with software deployment is that it is almost always an afterthought, so much time and effort goes into developing this great software, but hardly any time goes into planning and building an effective deployment strategy. When finally delivering the product to the client and deployment goes awry, the client starts developing second thoughts about the quality of your product.
This got me spending some time considering my deployment options in a more thorough way. Usually when I deploy an application I go to the client and install it for them, trouble shoot any installation issues and when there is a new release I either log in remotely, upload the new assemblies and update the database manually(using scripts) and everything is up to date.
In this scenario things will be a bit different as I won’t have remote access to the client machines and visiting on-site will probably not be an option. Thus I have opted to use ClickOnce deployment, with the deployment folder on a web site. This is great for dll’s and exe’s but what about database changes?
Since we have to assume that the person using the application won’t be tech-savvy enough to manually run scripts on the database(using SQL Management Studio Express, with SQL Express 2005), I have to think of a smarter way to deploy scripts on the remote database. So, I’ve come up with a solution:
In the application, there will be a button "Check for update" this button will first connect to the same ClickOnce server and download a zip file in the format _Scripts.zip i.e. CALC1.0.1_Scripts.zip. In this zip file is all the scripts required to update the database to the latest release. After the zip file is downloaded, the scripts will be extracted and run. After this is complete the normal ClickOnce update will happen. Perhaps not the most elegant approach but effective in the tests I’ve run so far.