Archive: How can I update the update file ?


How can I update the update file ?
Dear all.

I made an update file update.exe that connect 2 the net,
downloads some files and replace 'em with existing files,

But how can I also update the Update.exe that do all that stuff ?
(must I use another app to replace this file ?)

Any ideas ?


Spawn another nsis installer as you suggested, or I guess you could use something like :-

File new_update.exe
Delete /REBOOTOK update.exe
Rename /REBOOTOK new_update.exe update.exe
Although I can't be sure that the order of the delete and the rename would be preserved on reboot, and obviously that technique requires an ugly reboot. I suggest you launch another exe, closing the first in the process, then the 2nd replaces the 1st.

Final suggestion: Don't use another app, copy the same app to temp, spawn it with a command line arg like /update and detect and obey the command line arg.

Got another idea...
I got another one,

at the end of the update (after I have update.tmp)
I can execute MyApp.exe /Update
and this will only replace update.exe with update.tmp

But how can I close the already running update.exe ?
(how can I find it with FindWindow() ?)


Why close it using FindWindow()? Why not instead just use Exec to run MyApp.exe and then quit the installer. MyApp can then replace the update.exe. If MyApp tries the replace too quickly you can wait for a bit or try replacing 10 times in a row until it succeeds, or something similar.


but what if the user just bought a big box full of yammi cookies and than he has 2 take a crap for one hour...

I guess the update will fail,
and I also don't like 2 check if there is a replace 2 do on each
execution of MyApp.exe

it could B great if I could replace update.exe at the end of the update (without waiting 2 some human reply)

But how the **** do I close the Update.exe (installer)


I don't understand what's hard about closing the update.exe. In update.exe do

Exec MyApp.exe
Quit

:-)
Hay man, U got a good point here :-)

4 some reson I had in mind that if I execute from update.exe I can not also close it,

but I guess U right,
I'm just about 2 try this

10X


Check the NSIS Update source (CVS), it copies itself to the temp folder and executes there (so it can update).


10X
Quote:


what is CVS ?
(where can I get it ?)

Originally posted by Joost Verburg
Check the NSIS Update source (CVS), it copies itself to the temp folder and executes there (so it can update).

CVS is the repository which holds the source code for NSIS and all other projects hosted on SourceForge (and has been in use by many projects the world over for years). It stands for something like Concurrent Version (ing?) System. A CVS server runs on SourceForge, you access it using a CVS client (like Tortoise CVS) or using the web front end (here).

The FAQ refers to this thread which gives some more info about NSIS CVS.


Yeah!
Quote:


Hay man, this is good stuff,
10X

Originally posted by Sunjammer
CVS is the repository which holds the source code for NSIS and all other projects hosted on SourceForge (and has been in use by many projects the world over for years). It stands for something like Concurrent Version (ing?) System. A CVS server runs on SourceForge, you access it using a CVS client (like Tortoise CVS) or using the web front end (here).

The FAQ refers to this thread which gives some more info about NSIS CVS.