In this blog I discussed ClickOnce deployment in Visual Studio 2005. Another benefit of this approach when used on Windows Forms applications that are to be used on many machines on a network is the ability for each copy of the installed software to check whether a later version is available. This check can either be made as the program starts up, or after the program starts up. In the latter case the upgrade will take place on the subsequent run.
In this scenario it's helpful to be able to see the publish version that any one machine is running. The code to do this follows. You'll also need to add System.Deployment into your project references.
If System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed Then
Dim ad As System.Deployment.Application.ApplicationDeployment =
System.Deployment.Application.ApplicationDeployment.CurrentDeployment
Dim version As String = ad.CurrentVersion.ToString
Me.Text = "My Program V" & version
End If
The information is provided 'as is'. It has worked for us,
but it may not work for you, so you use it at your own risk. We can't
enter into any correspondance about anything recorded here but please feel free to leave a comment.
Geographical coverage: AlphaOne Computing Services
provides a range of small business computer support and I.T. services throughout Sussex, including
Brighton, Hove, Shoreham, Worthing, Steyning, Burgess Hill,
Haywards Heath, Crawley, Lewes, Newhaven, Seaford, Uckfield and Eastbourne.