My own autoupdater - problem

M

Martijn Cox

Hello,

I have created an autoupdater webservice for my PPC2003 application, and
have managed to retrieve the download.cab from my web service on my device.
Next, however, while trying to install the new version, I run into the
fundamental problem of not being able to run the installer cab, since the
old version of the application (which has spawned the autoupdate request) is
still running. When wceload then tries to install the cab, it rightfully
complains of a lock on the application executable, not being able to
overwrite the currently runnning version.

Of course the simplest workaround would be to let the user run the
update.cab file after closing the application, but there is no guarantee my
user base will be tech-savy enough to perform the necessary actions (that
is, a) open an explorer and b) let wceload.exe execute the cab-file by
clicking on it). I can think of some other options (create a process which
kills the current user application), but they don't seem elegant, requiring
much works for something that is or seems to be so simple.

Is there a simple solution for this problem?

Thanks in advance,

Martijn Cox
 
C

Carmine Moleti

I have created an autoupdater webservice for my PPC2003 application, and
have managed to retrieve the download.cab from my web service on my device.
Next, however, while trying to install the new version, I run into the
fundamental problem of not being able to run the installer cab, since the
old version of the application (which has spawned the autoupdate request) is
still running. When wceload then tries to install the cab, it rightfully
complains of a lock on the application executable, not being able to
overwrite the currently runnning version.

Of course the simplest workaround would be to let the user run the
update.cab file after closing the application, but there is no guarantee my
user base will be tech-savy enough to perform the necessary actions (that
is, a) open an explorer and b) let wceload.exe execute the cab-file by
clicking on it). I can think of some other options (create a process which
kills the current user application), but they don't seem elegant, requiring
much works for something that is or seems to be so simple.

Hi,

I'm still newbie on .Net but, from what I know, I think you should split
the autoupdate and the core app in two different appdomains.

I mean, having the main appdomain which checks for updates, download
them and install them.
More, this main appdomain takes care of launching the real application
in a separate appdomain.
This way should allow you to unload the real app and do the update.
Of course, it could happen that you'll need to also update the main
application (the one that implements the autoupdate feature). But I
guess it'll happens less frequently.

HTH,
Carmine
 
M

Martijn Cox

Thanks for the advice, it helped me discoverer that the trouble was very
likely not located in the area I thought it was.
The reason why the app wouldn't release its lock on its main executable, is
because the downloading process opened a few threads that I didn't know
about, and where kept alive without my knowledge. I figure the application
never exited, because it could not end the threads.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top