[Help]Auto Update

Posts 1–8 of 8 · Page 1 of 1
[Help]Auto Update
I am making a complex program hopefully to be released in the near future. (Intentionally evasive) In my program I have a 'check for updates' menu tab that opens a new form. On this form i have a single button, which when pressed downloads a text file from the server.

This code has no errors as I can see it just doesn't do what i want...


Code:
Private Sub WebClient_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient.DownloadFileCompleted
        MsgBox("Checking complete")
        readit.Text = My.Computer.FileSystem.ReadAllText("Version.txt")
        If readit.Text.Length > 7 Then
            Downloadfile("http://www.MyServer.com\Version.txt")
            Exit Sub
        End If
        Dim updatedVersion As Double = Val(readit.Text)
        Dim currentVersion As Double = Val(Application.ProductVersion)

        UVer.Text = readit.Text

        If updatedversion > currentversion Then
            MsgBox("New Update Avalible!")
            System.Diagnostics.Process.Start("http://www.UpdateSite.com")
        Else
            MsgBox("No Updates Avalible")
        End If
    End Sub
When the code is done,
currentVersion = 1.0 , where in the project assembly it is 1.0.0.0
updatedVersion = 5.0 , where in the text file it is 5.0.0.0

Am I using the wrong variable type? I want the,
Code:
If updatedversion > currentversion Then
            MsgBox("New Update Avalible!")
            System.Diagnostics.Process.Start("http://www.UpdateSite.com")
        Else
            MsgBox("No Updates Avalible")
        End If
To compare the whole number not just the first 3 characters....


Thnx
Hmmm.... or you can use Visual Studio's built in check for update feature.

Just a thought
Quote Originally Posted by NextGen1 View Post
Hmmm.... or you can use Visual Studio's built in check for update feature.

Just a thought
LOL Nextgen
@ snotpig Ugleh posted a TUT on how to use a text file to check for updates. Use the all powerful search tool
Agreed, Search, Didn't I add it in the tuts?

In either case, Everyone here by now knows how I am about cleanliness in code , Visual Studio will generate the code on build and publish, all you have to do is follow the steps.
lolz....

I have no idea, but myserver.com? It's .org

yea, i probably spouted some stupid words there.
Quote Originally Posted by Bluthera View Post
lolz....

I have no idea, but myserver.com? It's .org

yea, i probably spouted some stupid words there.
Lol, I made that up because i didnt want to show my username on this other site...

Its strange even though people looked at this thread the never answered my question. Maybe if i just said it instead of giving examples.

What type should I use if i want to see if 1.2.3.4 is > 1.2.4.3?
Quote Originally Posted by snotpig View Post
Its strange even though people looked at this thread the never answered my question. Maybe if i just said it instead of giving examples.
you should follow their advice and use the feature
Quote Originally Posted by Bluthera View Post
you should follow their advice and use the feature
I will, but what if I want to see if one number is bigger than the other. COMPLETLY unrelated to version checking...

PS. I've never see/used the built in updater before, where/how do i use it? Im using VB 2008 Express.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?