Return to Snippet

Revision: 17473
at September 8, 2009 21:55 by brandonio21


Updated Code
'Updater code for Visual Basic 2008 Express Edition - Coded by brandonio21 @variables - Find them at the website below
    'This code is at build 154 [Currently working 100%]
    'If you are having problems with this code, please consult : http://snipplr.com/view/19324/program-updatervb2008/
    Private Sub updatecheck(ByVal msg As Boolean, ByVal currentversion As String, ByVal txtdocumentaddress As String, ByVal exeaddress As String)
        If My.Computer.FileSystem.FileExists(CurDir() & "/updater.exe") Then
            My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.exe")
        End If
        If My.Computer.FileSystem.FileExists(CurDir() & "/updater.txt") Then
            My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
        End If
        If My.Computer.Network.IsAvailable = True Then
            My.Computer.Network.DownloadFile(txtdocumentaddress, CurDir() & "/updater.txt")
            Dim lolz As New TextBox
            lolz.Text = My.Computer.FileSystem.ReadAllText(CurDir() & "/updater.txt")

            curver = currentversion
            If curver = lolz.Text Then
                If msg = True Then
                    MsgBox("You have the most recent version!")
                Else

                End If
            Else
                My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
                My.Computer.Network.DownloadFile(exeaddress, CurDir() & "/updater.exe")
                Shell(CurDir() & "/updater.exe")
                End
            End If
        Else
        End If
    End Sub

Revision: 17472
at September 6, 2009 18:50 by brandonio21


Updated Code
'Updater code for Visual Basic 2008 Express Edition - Coded by brandonio21
    'This code is at build 154 [Currently working 100%]
    'If you are having problems with this code, please consult : http://snipplr.com/view/19324/program-updatervb2008/
    Private Sub updatecheck(ByVal msg As Boolean, ByVal currentversion As String, ByVal txtdocumentaddress As String, ByVal exeaddress As String)
        If My.Computer.FileSystem.FileExists(CurDir() & "/updater.exe") Then
            My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.exe")
        End If
        If My.Computer.FileSystem.FileExists(CurDir() & "/updater.txt") Then
            My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
        End If
        If My.Computer.Network.IsAvailable = True Then
            My.Computer.Network.DownloadFile(txtdocumentaddress, CurDir() & "/updater.txt")
            Dim lolz As New TextBox
            lolz.Text = My.Computer.FileSystem.ReadAllText(CurDir() & "/updater.txt")

            curver = currentversion
            If curver = lolz.Text Then
                If msg = True Then
                    MsgBox("You have the most recent version!")
                Else

                End If
            Else
                My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
                My.Computer.Network.DownloadFile(exeaddress, CurDir() & "/updater.exe")
                Shell(CurDir() & "/updater.exe")
                End
            End If
        Else
        End If
    End Sub

Revision: 17471
at September 6, 2009 18:49 by brandonio21


Initial Code
'Updater code for Visual Basic 2008 Express Edition - Coded by brandonio21
    'This code is at build 154 [Currently working 100%]
    'If you are having problems with this code, please consult : 
    Private Sub updatecheck(ByVal msg As Boolean, ByVal currentversion As String, ByVal txtdocumentaddress As String, ByVal exeaddress As String)
        If My.Computer.FileSystem.FileExists(CurDir() & "/updater.exe") Then
            My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.exe")
        End If
        If My.Computer.FileSystem.FileExists(CurDir() & "/updater.txt") Then
            My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
        End If
        If My.Computer.Network.IsAvailable = True Then
            My.Computer.Network.DownloadFile(txtdocumentaddress, CurDir() & "/updater.txt")
            Dim lolz As New TextBox
            lolz.Text = My.Computer.FileSystem.ReadAllText(CurDir() & "/updater.txt")

            curver = currentversion
            If curver = lolz.Text Then
                If msg = True Then
                    MsgBox("You have the most recent version!")
                Else

                End If
            Else
                My.Computer.FileSystem.DeleteFile(CurDir() & "/updater.txt")
                My.Computer.Network.DownloadFile(exeaddress, CurDir() & "/updater.exe")
                Shell(CurDir() & "/updater.exe")
                End
            End If
        Else
        End If
    End Sub

Initial URL

                                

Initial Description
Variable/Parameter Discussion : 
msg = Do you want to display a message box if you have the current version? (true/false)
currentversion = The version of the program
txtdocumentaddress = The text document web address containing the most updated version
exeaddress = the location of the updater .exe  [You can make this with WINRAR - To learn how to do this goto : http://www.hotlinkfiles.com/files/2799514_xsw67/tut.txt


\This is my first snipplr post, Hope you enjoy/
    This coding is used in *Brandons Timer 9* and *Brandons HTML-Ide*

Initial Title
Program Updater(vb2008)

Initial Tags
download, free, update

Initial Language
VB.NET