The following code downloads the latest program release from our web site. The problem is, I need to download the currently running EXE file...therefore it needs to download and replace itself.
I've renamed the file at the web site to program.ex_ and downloading that file to the current folder works OK.
How do I replace the running EXE with the revised EX_ once the download is complete and the program is still running.
Private Declare Function URLDownloadToFile Lib "urlmon"_ Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal_ szURL As String, ByVal szFileName As String, ByVal_ dwReserved As Long, ByVal lpfnCB As Long) As Long
If getUpdate = 1 Then
OKToDownload = MsgBox("Download latest program_ update ?", vbOKCancel)
If vbOK Then
) Then MsgBox "Download complete!"
MsgBox "Download cancelled"
Public Function SaveURL(ByVal sURL As String, ByVal_ sFileName As String) As Boolean
sfile = App.Path & "\program.ex_"
SaveURL = URLDownloadToFile(0&, sURL, sfile, 0, 0)