I need a little help

I want to create an option in my project where you can check and download updates for it. How would this work? Thanks
[118 byte] By [DJ24966] at [2007-12-16]
# 1

The first step would be to add the System.Deployment.dll

That will open up a set of methods that will allow you to work with a ClickOnce deployment. And, using My, makes it very easy to do.

Here's some sample code that will check for, and download the latest version. You can get a little slicker by doing it Asynchronously so you can download in the background. This code will block the app while it checks and downloads the new version, but it should give you a good idea how to get it working...



If My.Application.Deployment.CheckForUpdate() Then

My.Application.Deployment.Update()

MessageBox.Show("A new update has been downloaded. Please restart the application to use the new version.")

End If

DavidGuyerMS at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2
Thats a problem for me... I'm kinda new to this stuff... lol
DJ24966 at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3
Wonderful. I think you've come to the right place. VB.NET is great, in my humble opinion.
DavidGuyerMS at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 4
After doing My.Application.Deployment.Update(), is there a simple way to restart the app for the user? In the past, I'd create a batch file that includes a time delay before starting the app, to give time for the current instance to close completely.

Right now, if there's an update available, I simply run the (network) setup program, then close the app. This seems to work, but is inelegant, and not useful with an asynch update.

MikeB

MikeBerro at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic Language...