Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Poor man's Replication (VB6)

    I am attempting to create a routine that will just copy the EXE file created with Visual Basic 6 from the installation directory down to the user's App.Path directory. This is so that I can distribute updates automatically.

    The idea is that users will install the application using the setup.exe generated by the package and deployment wizard. Then, each time the user launches the program, it will check the local exe with the exe in the installation setup directory (that I have on the network). If the FileDateTime is different, then it will copy the network exe down and replace itself in the user's App.Path directory.

    My question is two fold:

    Well, has anyone done anything like this and is this a stupid idea overwriting an exe during the process of its execution?

    and

    The FileDateTime doesn't appear to work for me because when the file is copied to my HDD from the network, the File Create Date is changed to the current date, meaning it will always copy the file. Should I be using a different method?

    Mike

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Poor man's Replication (VB6)

    You probably need to check something other than the file date. You could use a registry key or a text file to store a value for comparison and check that against a value in a table to see if they match. If not, then you would run your code to update the front end.
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Poor man's Replication (VB6)

    The right way to do this is to calculate some checksum for the .exe.

    Include the checksum as a property of the .exe and check the checksum, version, date, and whatever.

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Poor man's Replication (VB6)

    Yes, I just figured out that I can grab the version information using the File System Object. Now I can determine if there is a new version on the server. I'm not sure what you were referring to regarding Checksum.

    Only issue that cropped up from this is that I can't very well copy the exe from the network onto the exe that is executing the code as it is write protected while running. I'm thinking of writing a separate exe that will launch first, do the copying, then launch the program. Do you agree with that approach?

    Mike

Posting Permissions

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