Results 1 to 4 of 4

Thread: Automatic Upgrade of My App by My App

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    Devon, England
    Posts
    4

    Automatic Upgrade of My App by My App

    Goor Morning,

    I have been trying all morning to find out if there was a simple way for an executable to upgrade itself.

    For example, I have an application ( exe ) running that verifies if there is a newer version of itself available on the intranet. If there is such a file, it would stop itself running, copy the file and restart itself.

    It should probably start the copy before stopping but then would it not generate an error during the copy operation ?

    I thought of writing a COPY program that would delay the copy until the exe has stopped running or something to that effect, but before trying further, I just wanted to know if anybody has inputs for me on this. I don't want to reinvent the wheel.

    Also, how to have the application restart itself after the copy operation ?

    Thanks for your help.

    NP

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    What you could do is this.
    Check if there's a new version. If there is, then download as a different filename. Then write another little app that waits to see until the main exe has ended.
    So once you download the file, run this other program, and then call End. Then the other program detects that the app has finished running, and then copies the newer executable on top of the old, and then runs it, and calls End itself ...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    I would suggest deviding your application into two exe files.
    First you have a small "launch exe" that will check for newer version and if not found launch the other exe (which is the actual program).
    If it founds a newer version simply copy it first and then launch the new version.
    You could let your "main exe" (that is not the launch program) require some sort of command line argument to launch.
    This command line argument is passed by the launch program.
    If the main program doesn't get the command line it launches the launch program and exit.

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Location
    Devon, England
    Posts
    4
    Thanks for your help guys, I appreciate it very much.

    I'll see what I can do with the two possible solutions you provided.

    Best regards,

    NP

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