Results 1 to 9 of 9

Thread: Update my app from my website

  1. #1

    Thread Starter
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435

    Question Update my app from my website

    Ok, this is what I would like to do for a future version of the VBCodeBook.NET, but i'm not sure how:
    • Have a textfile on my site called "Update.txt"
    • In the text file have just two lines: a main program version and codepack version (e.g: "2.0" and "12").
    • User selects "Update" from a menu
    • App looks at a set Http:// path for the file "Update.txt"
    • Loads / Reads the text file and checks each line against a hard coded version number of the app and Codepack.
    • If any are different, tell the user there's an update available.
    Is this possible?

    Go on, I dare you!
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  2. #2
    Hyperactive Member phrozeman's Avatar
    Join Date
    Apr 2000
    Location
    Netherlands
    Posts
    442
    Ofcorse its possible
    Only don't got an example here, maby i will try to fix something later tonight
    There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Update my app from my website

    Originally posted by RealNickyDude
    Ok, this is what I would like to do for a future version of the VBCodeBook.NET, but i'm not sure how:
    • Have a textfile on my site called "Update.txt"
    • In the text file have just two lines: a main program version and codepack version (e.g: "2.0" and "12").
    • User selects "Update" from a menu
    • App looks at a set Http:// path for the file "Update.txt"
    • Loads / Reads the text file and checks each line against a hard coded version number of the app and Codepack.
    • If any are different, tell the user there's an update available.
    Is this possible?

    Go on, I dare you!
    umm the new installshield has an update feature. That is, if you are willing to buy it
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4

    Thread Starter
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    You're right, it does (I have an old, but free-off-a-mag version), but that means the updates are installer specific. What happens if the user hasn't downloaded the installer version?

    If possibe, I would like to do it within VB so no matter how it's downloaded, all can use the update service.
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  5. #5
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551
    Here's the code using Windows Sockets that will actually retreive the text contents of the file from the internet...


    VB Code:
    1. Imports System.Net
    2. Imports System.Net.Sockets
    3.  
    4.  
    5. Dim sckClient As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
    6. Dim EP As IPEndPoint
    7. Dim strRequestedPage As String
    8.  
    9.  
    10. 'Create New Endpoint based on the server we're accessing
    11. EP = New IPEndPoint(Dns.Resolve("www.famousplayers.com").AddressList(0), 80)
    12.  
    13. 'Connect to the EndPoint
    14. sckClient.Connect(EP)
    15.  
    16. 'Create a byte array, and create an http GET request for the specific page we want
    17. Dim httpSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes("GET [url]http://www.famousplayers.com/showtime_search_result.asp?tCity=Windsor&tDate=[/url]" & dteTheDate.ToShortDateString & "&tTheatre=499&tMovie=" & vbCrLf)
    18.  
    19. 'Send the actual HTTP request
    20. sckClient.Send(httpSend)
    21.  
    22. 'Loop Until data is received
    23. Do
    24.     If sckClient.Poll(1, SelectMode.SelectRead) = True Then
    25.        
    26.         'Create a new byte array sized from the socket's available data
    27.         Dim recText(sckClient.Available) As Byte
    28.  
    29.         'Fill the byte array with received data
    30.             sckClient.Receive(recText)
    31.  
    32.         'Fill a variable with the requested page.  We converted Bytes into ascii readable text
    33.                 strRequestedPage = System.Text.ASCIIEncoding.ASCII.GetString(recText)
    34.  
    35.         'We received the data so we can now exit the loop
    36.                 Exit Do
    37.  
    38.         Else
    39.         'Data not ready, so sleep for a millisecond so the program does not lock up
    40.                 Threading.Thread.Sleep(1)
    41.     End If
    42.    
    43. Loop
    44.  
    45. ' Shutdown and Close the socket. You must always do this
    46. sckClient.Shutdown(SocketShutdown.Both)
    47. sckClient.Close()

    After that, the rest is simple string manipulation... shouldn't be hard... it would be cool if you made it automatically download the update itself... that would be more work, but at least with this, you could recognize that a new update is available, and even open up a browser to the download page... that might be the easiest and least intrusive method

  6. #6

    Thread Starter
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    Thanks,
    VB Code:
    1. 'Create a byte array, and create an http GET request for the specific page we want
    2. Dim httpSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes("GET [url]http://www.famousplayers.com/showti...=Windsor&tDate=[/url]" & dteTheDate.ToShortDateString & "&tTheatre=499&tMovie=" & vbCrLf)
    Would you put your own path to the text file here?

    E.g:
    VB Code:
    1. Dim httpSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes("GET [url]http://www.mywebsite.co.uk/updatefolder/updatetest.txt[/url]" & vbCrLf)
    and does the entire code (apart from the Imports) go into a Private Sub, ready to be called?
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here is a link that will allow you to do what you want.

    http://msdn.microsoft.com/msdnmag/is...S/default.aspx

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Does XML support what you are trying to do ??? If so then it's nice to go for it !

  9. #9

    updater

    I have a app you can use for such a job

    Download LiveUpdater

    If the source isn't in the zip file ask me and I shall send it to you.

    Russ

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