Archive: Problem...


Problem...
I have a small update part to my app, which checks the internet for updates, and then downloads the update.
Now, the update that I want to download is actually the app itself, so how can I get my app to be updated?

-Stu


What's your "small update part"? some nsis installer that is installed with your application and allows user to update main application?

If yes, you need to know the destination of app itself (using registry for e.g.) and download internet update to some temporary file, then when completed do copyfile over the old file,

If I understood your problem, I think that your problem can be solved this way.

cyas
Ramon


No.
My installer wants to update itself.
On init, it checks for updates, and if there is one, I want it to download the update over itself, quit, then reload.

This is not possible is it?

-Stu


Yes, it's possible but of course installer cannot write over itself, but you can do this:

- GetTempFile and download to that file
- You can ask user where he want to store updated installer
- After download complete call Exec on that file and quit as fast as possible

good luck


But it still won't overwrite itself, and the user might select the non-updated installer to save over, and then it won't download.

I've simply got it to save to a different file, opened up the saved-to dir, and told the user to manually overwrite it (kinda ugly way of doing it)

-Stu


Do what NSIS Update and the uninstaller does. Copy over your installer to a temporary file, execute it with a special command line parameter and have it update the original file. You can also create a small updater that will be called if there's an update.