bilal
bilal

Reputation: 725

C# Updater for Windows App

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?

Upvotes: 0

Views: 870

Answers (4)

aschepis
aschepis

Reputation: 764

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:

Upvotes: 0

Oliver
Oliver

Reputation: 45119

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.

Upvotes: 0

Mau
Mau

Reputation: 14478

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.

Upvotes: 0

Maxem
Maxem

Reputation: 2684

  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

Upvotes: 1

Related Questions