Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace EXE with a button click 1

Status
Not open for further replies.

jester4281

IS-IT--Management
Sep 12, 2002
160
0
0
US
Is there a way from within the application to have a user click a button, run out and test the version of an exe and replace the current one if it is newer. I know how to run the version test, but how can I make the code Quit the application and replace the exe with the newer one.

Ex.

Test if the current EXE is equal to the exe in location f:\Upadate if False, quit application and replace C:\Folder\File.exe with F:\upate\file.exe
 
hi
COPY FILE c:\FOLDER\file.exe TO c:\update\file.exe

u tried this
 
You can need a seperate process. In short you need another exe. Usually this type of thing is done with a LOADER program...the loader's job is to check the version of your main exe and if it needs to be replaced then it will replace it. After replacing the exe (or not depending on if there was an update available) the loader then runs your application. The shortcuts and stuff that the user uses would need to be changed to run the loader rather than your application at first. That's the easy way to do it. It is possible that you could have your program start up another program that would then kill you program's process if an update was available and then when it was done overwriting the exe it could start your application again, but this method is convoluted at best.

boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
An example of a "loader" program that you might want to consider is in the FAQ's

An Application starter (with auto copy from server into local station)
submitted by ramani

You could modify it as needed.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top