This project is read-only.

PrankyMat's Program Updater 1.0

Ever wanted to update your client's program? Here is a dll library that you should use in your Visual Basic project. It is fairly easy to use.

In order to use this library, you first need to have either a file server or dropbox. Upload the updated installer to the server and create a file named "Version.txt" containing  the version of the updated file.
Include the public link to the code and it should work. 


Imports Update.Update

Public Class Form1

    'Declaration of the update library
    Dim updater As New Update.Update

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Checks for internet connection
        If updater.CheckConnection() = False Then
            'Alert user that internet connection is not available
            MsgBox("No internet connection available!", MsgBoxStyle.Critical)
            'Optional: Application.Restart() <- Restarts the program
            'Optional: Application.Exit() <- Quits the program
        End If

        'Checking if new version is available.
        If updater.CheckIfNewVersion("0.1", New Uri("")) Then
            'New update is available
            MsgBox("New update is available! Download?", MsgBoxStyle.OkCancel)
            If MsgBoxResult.Ok Then

                'MsgBox OK pressed, start the download
                Dim DownloadedFilePath As String
                DownloadedFilePath = _
                updater.DownloadUpdatedFile(New Uri(""))

                'Run the update installer
                Shell(DownloadedFilePath, AppWinStyle.NormalFocus, False)

                'MsgBox CANCEL pressed
            End If
            'Program is up to date
            'MsgBox("Your program is up-to-date", MsgBoxStyle.Information)
        End If

    End Sub
End Class


Last edited Jan 24, 2013 at 12:41 PM by prankymat, version 2


No comments yet.