Check for new software update option is always nice to have in your software. So your users can check for new versions without visiting your website. Here is complete tutorial/code for it. So have online update check for software from your next release.
You can use same logic as below in any programming language but here I am explaining it for VB .Net
Big softwares use own update server because they have users like 100k or more. For smaller software we will just use a PHP file or simple text file.
Basically what we will do is we will put a text or php file on server. the file will have the current version number. If the version number is not matching that means your software have update, redirect user to update link.
To do this take a new form, add a web browser on it. Set webbrowser’s visible property to false.
Now on form load event set web browser to visit your txt file or send current version to a PHP file as query. e.g. update.php?ver=1.0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Now when the document gets loaded , it’s time to compare current and latest version.
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If (WebBrowser1.DocumentText = currentversion) Then
MsgBox(“You have the latest version of the software”)
MsgBox(“An update is available, click ok to download”, MsgBoxStyle.OkCancel)
If (MsgBoxResult.Ok) Then
Where new version is version of current software, where you can use any variable or any defined version in software meta data.You can use webbrowser1 to navigate to new version instead of launching your download in system default browser.
In PHP file you have to process the query and send download file accordingly to the added web browser which is more advanced.
Now , just give a link to “Check for updates” in the menu of our software and load the created form using
Make design and working changes as per your taste, the method/logic will be same.
Tip: Use ProgressBar to make the download look more professional.