Results 1 to 13 of 13

Thread: Auto-update help. . .

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Posts
    49

    Unhappy Auto-update help. . .

    I need some pointers. I'm developing a program for an oil and gas company. Currently they're using the program as I'm coding it. By that I mean I release an alpha version, they play with it, find bugs, create a wishlist, etc. I update the program. They play with it find bugs, etc. etc. etc. Anyway, I want to have my program auto-update if there's an update available. It's running on an SQL Server, and currently I've got a [Version] table that has 3 fields, [CurrentVersion], [UpdatePath], and [LockDB].

    [CurrentVersion] = the version the client .exe should be at
    [UpdatePath] = the path to the new .exe
    [LockDB] = a way for me to lock the database for maintenance, etc.

    When the program starts, it checks the value of [CurrentVersion] against the version of the app, and if it's not the same, it makes a backup copy of the .exe, copies the new .exe from [UpdatePath], and exits the program.

    Problems so far is the .exe is the only file that gets updated. There could possibly be .dlls, images, and reporting files that need to be updated as well.

    If anyone has done this sort of thing before or has any suggestions I'd appreciate it.

    Thank you,

    Leecher

  2. #2
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    Search the forums for Auto Update

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Whats the main problem?

    Say you needed to update the EXE a dll and an image. Well after the auto update client determines the EXE version is out of date all the new files should be sitting in your server waiting to be downloaded so when the client returns the need for an update just set up a download queue, using say winsock, for the new versions of each file.

  4. #4
    Junior Member
    Join Date
    Jun 2004
    Posts
    27

    Re: Auto-update help. . .

    Originally posted by Leecher
    I need some pointers. I'm developing a program for an oil and gas company. Currently they're using the program as I'm coding it. By that I mean I release an alpha version, they play with it, find bugs, create a wishlist, etc. I update the program. They play with it find bugs, etc. etc. etc. Anyway, I want to have my program auto-update if there's an update available. It's running on an SQL Server, and currently I've got a [Version] table that has 3 fields, [CurrentVersion], [UpdatePath], and [LockDB].

    [CurrentVersion] = the version the client .exe should be at
    [UpdatePath] = the path to the new .exe
    [LockDB] = a way for me to lock the database for maintenance, etc.

    When the program starts, it checks the value of [CurrentVersion] against the version of the app, and if it's not the same, it makes a backup copy of the .exe, copies the new .exe from [UpdatePath], and exits the program.

    Problems so far is the .exe is the only file that gets updated. There could possibly be .dlls, images, and reporting files that need to be updated as well.

    If anyone has done this sort of thing before or has any suggestions I'd appreciate it.

    Thank you,

    Leecher
    I would like to know how you do that, im thinking of building an auto updater, but how do you update the EXE if its open? copy then copy again? kinda a pain isnt it?

  5. #5

  6. #6
    New Member
    Join Date
    Jan 2005
    Location
    Tampere, Finland
    Posts
    5

    Re: Auto-update help. . .

    1. Put on your program versio: Versio="0200013210" Or something
    2. Put your exe make 'Update'-folder
    3. Make web-page (on someplace)
    4. Put info file (prog.inf or something) there. On file you have information of latest version. Like this information:
    --
    0200013211
    20.03.2004
    http://name of place where new exe is. Make zip what will start in own.
    --
    Inf - file is same place every time but you can change plase where new version is

    5. Make your program to load that inf file and check version: Bigger on web then load it.
    6. If load then load new exe to update folder.
    7. Start it there and let old shutdown.
    8. Let new version to owerwrite old

    There are now new version on your client to use. I use this format on my own programs and it did some work to get it usefull but it has work many years
    ---
    VB programming since 01/96

  7. #7

  8. #8
    New Member
    Join Date
    Jan 2005
    Location
    Tampere, Finland
    Posts
    5

    Re: Auto-update help. . .

    Too much information to cut out from my code but I hope that you get a point what I did write and try to imitate it then... Some information on on my code is secret (by my firm)... Sorry...

    --
    Edit
    --
    Okei... I see that yours update system are similar than my but my only are limited to program exe... And also yours are out of prog (my are build in and fixed to usefull to program)... Nice coding ...
    Last edited by Tare69; Jan 12th, 2005 at 08:31 AM.
    ---
    VB programming since 01/96

  9. #9
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Auto-update help. . .

    Hhaahaha...fair enough.
    The code in my sig can be added to ANY project to add live auto update features...silent updates, or controlled by wizard for more control. You can even distribute new software using my dll.

    To add auto update functionality to your code, using my DLL, all you have to do is:
    Code:
    Private WithEvents mobjLiveUpdate As LiveUpdate
    
    Private Sub CheckForUpdates
       Set mobjLiveUpdate = New LiveUpdate
       mobjLiveUpdate.RemotePath = "http://www.woof.com/downloads/"
       mobjLiveUpdate.Products.Add "WOKA", "Wokawidgets Application", "3.2.0048"
       mobjLiveUpdate.DownloadUpdates
       'This does an automatic update. For a interactive wizard use:
       'mobjLiveUpdate.Show
       Set mobjLiveUpdate = Nothing
    End Sub
    
    Private Sub mobjLiveUpdate_InstallProductUpdates(ByRef Product As vbLiveUpdate.Product)
    Dim strFilename As String
      strFilename = mobjLiveUpdate.RemotePath & Product.Update.Filename
      'now do something with file.
      'either copy it to it's destination
      'or if it's a setup package then use Shell command to launch it
    End Sub
    That is pretty much all you need to add LiveUpdate features to ANY app.

    Woka

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Auto-update help. . .

    what seems like a simle way to me is to have a separate program, so that if yours needs update it will call the update program and close. the update program can copy all the files from the specified path then restart the main application.


    rgds pete

  11. #11
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Auto-update help. . .

    Sorry, didn't realised you looked at it.
    From what I gather, our methods are similar.
    You look at a web page and stip product info from there, I download a file, and strip info from that. You actually place the file data into the web page.

    Do you have a progress bar on yours? Or are you using the iNet control?
    My download class has callbacks and allows you to have a prog bar.

    Once the file is downloads then I am assuming you execute it, like me. I think it's just that I have split all my code off into a neat and resuable component. Plus mine can do multiple app updates at the same time.

    Woka

  12. #12
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Auto-update help. . .

    Quote Originally Posted by westconn1
    what seems like a simle way to me is to have a separate program, so that if yours needs update it will call the update program and close. the update program can copy all the files from the specified path then restart the main application.

    rgds pete
    Yup...well sort of...what if it's the LiveUpdate program that there is an update for???
    I would distribute seperate DLL's/EXEs this way. I would create a setup package using Inno.
    If any of the files are in use when it's installed then it will ask you to reboot your PC. When you do this windows copies the new files on startup.

    Woka

  13. #13
    New Member
    Join Date
    Jan 2005
    Location
    Tampere, Finland
    Posts
    5

    Re: Auto-update help. . .

    Quote Originally Posted by Wokawidget
    Sorry, didn't realised you looked at it.
    From what I gather, our methods are similar.
    You look at a web page and stip product info from there, I download a file, and strip info from that. You actually place the file data into the web page.
    Woka
    It do not load web-page, it load that inf-file from web folder to update-folder in my computer... It changes "ProgName.inf" to "UpdateNow.inf" when it load it to "Update" folder on app-path. Some changes if I make then it can load information from web-page... My 3 progs uses this system...

    Quote Originally Posted by Wokawidget
    Do you have a progress bar on yours? Or are you using the iNet control?
    My download class has callbacks and allows you to have a prog bar.
    Woka
    I have check points: "Check New Update" and "Download Update" + two buttons: "Check Updates" and "Cancel/Return". It can also check updates when it starts... I use class (almost similar to yours) but it have on information on inside...
    Quote Originally Posted by Wokawidget
    Once the file is downloads then I am assuming you execute it, like me. I think it's just that I have split all my code off into a neat and resuable component. Plus mine can do multiple app updates at the same time.
    Woka
    Yes. It is zip-file what is auto unzip exe... I have had no needs to add components to that zip... My full packs have components and appnormal components are not uset... Some times I update also faq, readme and manual. In Pitkaveto 2.0 Millennium prog I have also system what reads new data-files from net (week information to soccer and so on)... It have almost same system but it reads full files from net (about 1600 files and counting) and if user have't file it then reads it to data folder...
    ---
    VB programming since 01/96

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