views:

74

answers:

4

Hi

i developed an updater application for my windows app. They are different projects under the same solution and they run as different processes. when i run the app it checks for updates at startup (as another process). when i click update button it tries to download files to the installation location. (i am using the .exe in debug folder i don't create setup file) Everything works fine but the main application (app.exe) can't be overwritten because it is used by update process. but in update process i kill app.exe and app.exe goes from task manager too. i couldn't find anything, how main app.exe is used by update. has anyone any idea how update uses main app ? how can i watch it? in which line it starts using the other app?

+1  A: 
  1. Rename app.exe
  2. Insert new app.exe
  3. Close running, old app.exe
  4. Start new app.exe
  5. Check for renamed app.exe (in newly started app.exe)
  6. Delete old, renamed app.exe
Maxem
it works greatThansk a lot
bilal
A: 

If the updater app has a reference to the main app exe, it will keep it locked. If that's the case, can you remove the reference to the main app from the update app project? This may need moving some code directly into the updater's source.

Mau
it had reference and i have thought so toothan i removed reference and i created a new .dll instead of itnow i don't have any reference but it is still lockedi am trying now what Maxem saidThanks to all
bilal
A: 

To find out who has a hand on your process you should start ProcessExplorer. There are some spy glasses in the menu bar. Just click on it and see which process holds a handle to your app.

Oliver
A: 

Do you need to invent your own? There are existing solutions that you may be able to leverage that already do this. Microsoft ClickOnce supports this if it fits your deployment model.

A quick google search turns up a few things as well:

aschepis