Results 1 to 16 of 16

Thread: Create a system for notification of updated software

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    104

    Create a system for notification of updated software

    Hello,
    I need to implement a notification system software for each new verson,
    I am interested only inform the user of the presence of updates, not autoupdate software, how can I do?
    Report your software freeware, it's free

    http://intotheapp.blogspot.com

    a blog with only free software

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Create a system for notification of updated software

    you could put a textfile on your website that contains the most recent version of your software. Then your app could check this textfile and compare the version to its own version, and notify the user of an update if its available.

    lets say your website had a text file called latestversion.txt, then you could write code like this:

    Code:
            'SOME CONSTANTS AND VARIABLES
            Const NEW_VERSION_AVAILABLE As Integer = 1
            Dim NewestVersionString As String = ""
            Dim NewsestVersion As Version = Nothing
    
            'USE WEBCLIENT TO DOWNLOAD VERSION TEXT FROM WEB
            Using WC As New Net.WebClient
                NewestVersionString = WC.DownloadString("http://www.mysite.com/latestversion.txt")
            End Using
    
            'LOAD VERSION STRING INTO AN ACTUAL VERSION OBJECT
            NewsestVersion = New Version(NewestVersionString)
    
            'COMPARE VERSION OBJECT WITH VERSION OBJECT OF CURRENT RUNNING PROGRAM
            If NewsestVersion.CompareTo(My.Application.Info.Version) = NEW_VERSION_AVAILABLE Then
                MessageBox.Show("New version available")
            End If

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    104

    Re: Create a system for notification of updated software

    you are great, in my mind i have something like this...
    i try to put this into a function into a class file but when i try to call the function from the class, it give me an error...
    why?
    Report your software freeware, it's free

    http://intotheapp.blogspot.com

    a blog with only free software

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Create a system for notification of updated software

    How could I possibly answer that when you don't explain what the error is you got, and which line of code causes it?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    104

    Re: Create a system for notification of updated software

    this is the line

    vb Code:
    1. NewsestVersion = New Version(NewestVersionString)

    the error is "wrong format of the input string"
    Report your software freeware, it's free

    http://intotheapp.blogspot.com

    a blog with only free software

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    104

    Re: Create a system for notification of updated software

    this is the line

    vb Code:
    1. NewsestVersion = New Version(NewestVersionString)

    the error is "wrong format of the input string"
    Report your software freeware, it's free

    http://intotheapp.blogspot.com

    a blog with only free software

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Create a system for notification of updated software

    you would get that error if the NewVersionString variable does not contain a valid version formatted string. The format of a version number in .NET is x.x.x.x where each x is a number.

    So what exactly does the textfile you put on the website look like?

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    104

    Re: Create a system for notification of updated software

    i change something in the code:

    vb Code:
    1. Dim versioneProgramma As String = "v1.0"
    2.         Dim NewestVersionString As String = ""
    3.         Dim NewsestVersion As String
    4.  
    5.  
    6.         Dim wc As New Net.WebClient()
    7.  
    8.  
    9.         NewestVersionString = wc.DownloadString("http://www.mywebsite.com/software_version.txt")
    10.  
    11.  
    12.  
    13.         'LOAD VERSION STRING INTO AN ACTUAL VERSION OBJECT
    14.         NewsestVersion = NewestVersionString.ToString
    15.         MsgBox(NewsestVersion)
    16.  
    17.         'COMPARE VERSION OBJECT WITH VERSION OBJECT OF CURRENT RUNNING PROGRAM
    18.         If NewsestVersion.CompareTo(versioneProgramma) = 1 Then
    19.             MsgBox("New version")
    20.         Else
    21.             MsgBox("Software update")
    22.         End If

    software_version.txt contains a string = "v2.0"


    in

    vb Code:
    1. MsgBox(NewsestVersion)

    i try to see what string the program read and the string is made with some carachters different from "v2.0"
    the string is: "ÝÞv"

    what's wrong?
    Report your software freeware, it's free

    http://intotheapp.blogspot.com

    a blog with only free software

  9. #9
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Create a system for notification of updated software

    So don't use v1.0, v2.0, use 1.0.0.0 and 2.0.0.0

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Oct 2007
    Posts
    104

    Re: Create a system for notification of updated software

    but "NewsestVersion" is a string and so it should compare string with string and so "v1.0" with "2.0"
    isn't it?
    Report your software freeware, it's free

    http://intotheapp.blogspot.com

    a blog with only free software

  11. #11
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Create a system for notification of updated software

    No. You are not comparing strings, you are getting a string, converting it to a version object (which is in the format of x.x.x.x) and then comparing this version object with the version object of the actual running exe file. If you right click on an exe file in windows and check the files version, does it say "V2.0"? No it will say 2.0.0.0 if it is in fact verison 2.0. So you need to use the format windows/.net uses for version numbers.

  12. #12
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Create a system for notification of updated software

    Sorry to bump this one.

    I usually download the textfile and read the value (e.g. 2.0.0.0). Works fine all the time, but as curious as I am, I had to try this one. Unfortunately I'm also getting the error. Look at screenshot:



    rule 49 states -according your example- : NewsestVersion = NewestVersionString.ToString

    My testing code (partial) "crashes" on line 10 with the error above:


    vb.net Code:
    1. Dim nVersionString As String = ""
    2. Dim nVersion As Version = Nothing
    3.  
    4. '   download file from the web
    5. Using wClient As New Net.WebClient
    6.     wClient.Credentials = New Net.NetworkCredential(usern, passw)
    7.     nVersionString = wClient.DownloadString(ftp_path & "/version.file")
    8. End Using
    9.  
    10. nVersion = New Version(nVersionString)


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Create a system for notification of updated software

    What is the value of nVersionString when the program errors on that line? You can set a break point on that line and hover over nVersionString to see its value.

    The only reason you should get that error is if nVersionString is not in a valid format of a version number.

  14. #14
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Create a system for notification of updated software

    Thanks for the info Kleinma, but it seems like I have found the problem which causes this issue. The problem seems to be within VS, but then I could be wrong.

    When creating a text-file, with a value like 2.0.0.0, within VS it returns: 2.0.0.0
    After creating a new textfile without the use of VS (on desktop), it returns the proper string: 2.0.0.0

    Seems that VS is doing some weird things after the build or is that normal behavior and I'm missing something.
    Last edited by Radjesh Klauke; Mar 12th, 2010 at 03:52 AM.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  15. #15
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Create a system for notification of updated software

    What text encoding are you using for your text file?

  16. #16
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Create a system for notification of updated software

    Where can I find that in VS? Searched in the options btw.
    Last edited by Radjesh Klauke; Mar 13th, 2010 at 05:17 AM.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width