Results 1 to 11 of 11

Thread: Auto app upgrade via web - novice question

  1. #1

    Thread Starter
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126

    Post

    I have fairly strong vb, but no web experience.

    I want to get my app to check if an update for my app is available. Some programs like RealPlayer G2 automatically check and will download an upgrade if one exists.

    Can anyone point me to a good example of how to do this?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    You could store the latest version number in the HTML of your Website, then have your app connect to your site and parse the HTML for the Version Number, if it's newer, download an update.

    Or..

    You could store a Small Flat File on your server, have your app download it, open it, check the Version and decide wether to update or not.

    Both can be done via the Winsock Control.


    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3

    Thread Starter
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126

    Post

    Nice one Aaron. Thanks.

  4. #4
    Lively Member
    Join Date
    Jan 1999
    Location
    California
    Posts
    115

    Post

    There is a nice story on the subject you're refering to on about.com

    link is here.

    ------------------
    Ryan French
    Niresoft Incorporated
    http://www.niresoft.com
    [email protected]


    [This message has been edited by Ryan (edited 10-11-1999).]

  5. #5

    Thread Starter
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126

    Post

    Quality advice Ryan, Thanks!

    James knows his stuff doesn't he?

  6. #6
    Member
    Join Date
    Oct 1999
    Location
    Richmond, Virginia
    Posts
    41

    Post

    If you work for a company that runs it's own website you could set up your program to contact the server using a winsock ocx. It could contact some infrequently used port to find the current version. If the app finds it is NOT the most up-to-date version it could contact another port which would automatically send the app the new files. The app could then place the files where they need to go and that would be that.

    Quick and painless. Check out Dolphin Software's DSSOCK.OCX website for information on their DSSock winsock control. It's really quite handy.

    TheLeeMan

  7. #7

    Thread Starter
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126

    Post

    I'm not really familiar with ports.

    Your idea sounds great, but could you give me a simple explanation of what ports are and are used for?

  8. #8
    New Member
    Join Date
    Jan 1999
    Location
    Memphis, TN, USA
    Posts
    14

    Post

    This is what I would do.
    Have two files. One on your local computer, and one on the server computer where you will be connecting to. call them:

    inventory.lst
    server.lst

    Have your app download the server.lst open it and compare it to the inventory.lst

    Construct the files like this:
    <filename>=<version>,<install path>,<register component>
    If this filename isn't in the inventory.lst or the version name isn't the same then download the file and put it in the install path. if its a register component (IE DLL or OCX) then place a 1 in register component field and run regsvr32.exe on that file.
    So your file would look something like this:

    regsvr32.exe=1,,0
    anomaly.bmp=1,/graphics/,0
    mscomctl.ocx=1,,1

    Once complete delete the inventory.lst and rename the server.lst to inventory.lst.

    If you make this auto update utility a different app, and make it the name of your app. IE: Explorer.exe (update utility) and Ex.exe (main app) then you could update the main app easily, and when the update utility is done, load the main app.


    Bryan

    [This message has been edited by Bryan (edited 10-18-1999).]

  9. #9
    Member
    Join Date
    Oct 1999
    Location
    Richmond, Virginia
    Posts
    41

    Post

    Brians idea for how to keep track of which file is the recent one, it's location, and how to install it is a good one.

    As far as the ports go, it doesn't really matter which ones you use. There is a master list you can download, as a standard no ports above 1024 have assigned tasks. So if you wanted to use port 5001 it would work fine. The number isn't really important.


    ------------------
    TheLeeMan
    EMail: [email protected]



  10. #10
    New Member
    Join Date
    Oct 1999
    Posts
    3

    Post

    I use an AutoUpdate feature for my program called AntiTimer. The problem is that the program is to be used for AOL, yet for some reason the Microsoft Internet Control doesn't work with an AOL connection (well, recently it won't. It worked for several months, and I didn't change anything).

    Does anyone know why the Internet Control won't work with AOL? When I check the program, it seems to pass right over the code, WITHOUT even waiting for a response from the internet connection. Why???

  11. #11
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126

    Post

    Use the winsock control directly, rather than using Internet Control.
    When downloading a file via Internet Control the whole program appears
    frozen and [not responding] as it is doing the download.

    However if you do the download via Winsock it wont freeze and just
    keep downloading bytes, allowing you add update timers and download rates etc..

    But when you download a file via Winsock directly you need to remove the HTTP
    header from the file downloaded. Internet Control does this automatically.

    I used the following parts of code for my progam that uses Web Update
    which downloads a newer version of the .exe for my main program and installs it.

    This code is not perfect, its from the top of my head, if you want the exact code
    Email me for it

    '---------------------------------------------------
    ' Download a file directly via Winsock via HTTP port
    '---------------------------------------------------
    '

    Dim DownloadData as String

    Private Sub DownloadCMD_Click()
    'connect to the web server directly
    winsock1.connect "home.yourisp.com", 80
    End Sub

    Private Sub Winsock1_Connect()
    'weve connected, lets send the HTTP request
    'you MUST have the two vbcrlf after the command
    winsock1.senddata "GET /username/filename.exe HTTP/1.0" & vbcrlf & vbcrlf
    End Sub

    Private Sub Winsock1_DataArrival(totalBytes as long)
    'weve recieved some data, append it
    winsock1.getdata TempDownloadString, vbString
    DownloadData = DownloadData & TempDownloadString
    End Sub

    Private Sub Winsock1_Close()
    'download has completed, save the data to a file

    Open "c:\download.dat" for output as #1
    Print #1, DownloadData
    Close #1

    Msbox "download complete"
    End
    End Sub

    '---------------- end of code -------------------------

    Thats how I did it for one of my programs, works for binary files also.
    But one important thing to notice, when you do download via winsock
    you need to remove the HTTP header at the top of the file.
    If you want the exact code of how to do it, email me
    The code ahead came out of my head and hasnt been tested.

    Hope this helps

    ICQ Network: 5355496
    Email: [email protected]
    Homepage: http://users.bigpond.com/privoli


    [This message has been edited by privoli (edited 11-08-1999).]

    [This message has been edited by privoli (edited 11-08-1999).]

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