Jump to content

Auto Updater [Help]

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
tmo

tmo

    Newbie

  • Members
  • Pip
  • 4 posts
I need an auto updater , which will download off an URL or for example- "mysite.com/project.exe"

any help?

Source wold be nice too :c-grin:

VB Version: 2010


Thanks.

#2
tmo

tmo

    Newbie

  • Members
  • Pip
  • 4 posts
i fixed.. i ended up using .xml on my server. ill post code too help someone else..

If getXMLValue(LabelX4.Text, "latestVersion") = "1.0.0.0" Then 'Change 1.0.0.0 to the assembly version of your app'

            MsgBox("No Update Found", MsgBoxStyle.Information, "No Update")

            Return

        Else

            If MessageBox.Show("Update found! Would you like to download?", "Update Found", MessageBoxButtons.YesNo) = DialogResult.Yes Then

                Dim wc As New WebClient()

                wc.DownloadFile("http://yoursite.com/app.exe", "Name of App")

            End If

        End If

        Return

    End Sub

    Private Function getXMLValue(ByVal update As String, ByVal setting As String) As String

        Dim xmlr As XmlReader = XmlReader.Create("http://yoursite.com/version.xml")

        xmlr.Read()

        xmlr.ReadToFollowing(setting)


        Dim value As String = xmlr.ReadString()

        xmlr.Close()


        Return value

    End Function