Launch New App To Update Main Program

swright

New member
Joined
Apr 8, 2011
Messages
1
Programming Experience
10+
I am writing an updater for our application and having an issue overwriting the files. Here is a long drawn out example. Test.exe is our main app and update.exe is our updater application. Test.exe needs to launch update.exe and then close test.exe. Update.exe will download the new updates from our website to a temp directory and then copy in the new updates. The problem I have is when Test.exe has an update and I try to copy in the new file it says it can't because test.exe is still in use. I "believe" this happens because test.exe is still running in the appdomain because update.exe was launched from test.exe before I closed that app. So do I try and create a new appdomain and launch update.exe from it or is there some other way I am just not seeing? Please help!
 
If you have both update.exe and text.exe in the same solution then I do not believe it is possible. The easiest way is to create a new dedicated project for the updater. After you have the updater finished, build the updater then add the update.exe from debug (or release) folder to the test.exe project (make sure it is included in the installation). To run the updater, use something like:

VB.NET:
Process.Start(Application.StartupPath & "\update.exe")

And visa-versa for running test.exe from the updater. I hope this helps you.

-Josh
 
Back
Top