Click here to Skip to main content
15,897,968 members
Articles / Programming Languages / Visual Basic
Article

AutoUpdate for VB.NET

Rate me:
Please Sign up or sign in to vote.
3.31/5 (8 votes)
1 May 2008CPOL1 min read 78.9K   3.8K   32   32
This is a DLL library to check for updates for your application.

Introduction

You can use this library for checking for updates for your application. It's simple and small (only one function). The update package must be a zip file.

Using the Code

The DLL only contains one function: CheckForUpdates in the AutoUpdate namespace.

It has the following arguments:

  • NewestVersionLocation As String - This is the file location on the Internet where your newest version is placed, in plaintext. The file can only contain, for example: 2.0.
    You can use a *.txt file for this, but any extension is possible.
  • NewestVersionDownloadLocation As String - This is the file location on the Internet where your newest application (files) are stored in a zip file.
  • UnzipDir As String - This is the directory where the files must be extracted. If you use an empty string, or you omit this argument, the startup path of the application is used.
  • DisplayWindow As Boolean - With this, you can choose to display the download window or not.
  • MsgBoxText As String - This is the message displayed in a MsgBox if there is an update available.
  • MsgBoxTitle As String - This is the title of that MsgBox.

For the source code, download the zip file above, it has comments on my own written code.

Using an empty string for the last four arguments means the same as omitting them.

Example to Use

VB.NET
AutoUpdate.CheckForUpdates(http://yourdomain.com/versions/app.txt, _
    "http://yourdomain.com/update_downloads/app.zip", "", True, _
    "Newer version available. Download it?", "")

References

History

  • 1st May, 2008: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: 'Ionic.Utils.Zip.ZipFile' is not defined Pin
pimb27-Feb-10 19:42
pimb27-Feb-10 19:42 
QuestionAbout the updater Pin
MatthewAuld23-Apr-09 23:05
MatthewAuld23-Apr-09 23:05 
AnswerRe: About the updater Pin
pimb224-Apr-09 4:37
pimb224-Apr-09 4:37 
AnswerRe: About the updater Pin
MatthewAuld25-Apr-09 20:58
MatthewAuld25-Apr-09 20:58 
QuestionAn example? Pin
davistv22-Jun-08 22:19
davistv22-Jun-08 22:19 
AnswerRe: An example? Pin
pimb28-Dec-08 8:28
pimb28-Dec-08 8:28 
GeneralAdding a feature Pin
Member 165764123-May-08 5:34
Member 165764123-May-08 5:34 
GeneralRe: Adding a feature [modified] Pin
pimb28-Dec-08 8:14
pimb28-Dec-08 8:14 
First of all, I'm really sorry that I respond so late but for some reason I'm not emailed if there are any reactions. I don't know if you need my library anymore, but anyway I have a reaction.

I think the problem is, is that you have getupdates() after the msgbox conditional. So the app is checking for updates, no matter which button of the msgbox was clicked (also, it's checking twice because of this). Secondly, Exit Sub doesn't exit the app. Use End instead. There isn't any msgbox if there aren't any updates, I'm sorry.

So, replace any Exit Sub with End , and remove the last getupdates() call.

Sorry again for my late reaction.
QuestionWhat about app.exe? Pin
Megalan4-May-08 5:34
Megalan4-May-08 5:34 
AnswerRe: What about app.exe? Pin
pimb25-May-08 1:53
pimb25-May-08 1:53 
GeneralRe: What about app.exe? Pin
Megalan5-May-08 3:27
Megalan5-May-08 3:27 
GeneralRe: What about app.exe? Pin
pimb26-May-08 2:05
pimb26-May-08 2:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.