New Version of Program updates

I have a program that I am maintaining, and periodically there are changes made and the program is recompiled.  I have a default location on our network were the new version is posted so that everyone using it can update their local computer.  I am looking for a way to automate this so on exitting the program if there is a new version it needs to be copied down to their local machine.  I have a routine that checks to see if the version on the network is newer that the one currently running that works fine. I have another program that will copy the file to the correct location, but I cannot figure out how to execute this program from with in the one currently running.  I could make this process a compiled dll but that would require installing it on all the computers that are currently running the software.  I was hoping to start copy program in the MDI form unload event so that once the program copy program starts the program will exit so that the copy can take place. Any ideas??
drg22Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
deightonConnect With a Mentor Commented:
open "overw.bat" for output as #1
print #1,"copy s:\server\prog.exe prog.exe"
print#1, "del overw.bat"
close #1

shell "overw.bat"
end
0
 
KurvyCommented:
Put the version checker in the unload statement of the application.  If the version on the net is newer then shell the copy  routine locally.  reinforce the copy routine to check whether the application has closed down if not then forcibly close it or alternatively poll until it has unloaded. Once the application has shutdown then copy the new version and then close down the copy application.
0
 
deightonCommented:
In more thourough form

Private Sub Form_Terminate()
Dim date1 As Date
Dim date2 As Date
Dim sAppPath As String
Dim sUpdatePath As String

'Examples only
sUpdatePath = "c:\prog.exe"
sAppPath = "a:\prog.exe"

date1 = FileDateTime(sAppPath)
date2 = FileDateTime(sUpdatePath)

If date2 > date1 Then
    Open "overw.bat" For Output As #1
    Print #1, "copy " & sUpdatePath & " " _
     & sAppPath
    Print #1, "del overw.bat"
    Close #1
    Shell "overw.bat"
End If

End

End Sub
0
 
drg22Author Commented:
I am sorry but I tried that and it didn't work, but I was able to get the answer from Kurvy to work though.  If Kurvy would like to lock the question I will reward the points. Thank you for the response Deighton.
0
 
drg22Author Commented:
The comment added by Deighton is worth some points I didn't see the second comment before. I added my comments if you relock the question I will award the points. Thanks again.
0
All Courses

From novice to tech pro — start learning today.