Re: Replacing a running file programmatically
Pvt Ryan wrote:
[..]
There is no mechanism in C++ to do that. You need to ask in the
newsgroup dedicated to your OS.
Damn. Strange though, eclipse can restart itself as can spybot after
updating..
Yes, and so can many other products. It does not mean that all that
is achieved using Standard C++ means. And Standard C++ is the only
thing we talk about in comp.lang.c++.
Maybe the answer is another exe that is started before exiting,
performs the move actions and then reinstates the original exe.
Maybe. How is that a C++ language problem?
I would like to avoid this particular method if possible as it adds
(imo) more complexity to the program. As the original EXE is the
updater for a different program the code i am looking for is so that
the updater can update itself.
On a multi-process OS what you'd do is start an updater (some kind
of tool which would download and install what you need) and make it
wait until the process that started it has finished. Then it will
do its thing, and [re-]start the installed executable. However, in
C++ there is no means to "wait for a process to finish". C++ is
a language that assumes a single-process virtual execution environment.
That's why you need to use the means available from your OS.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask