Old 2nd July 2003, 19:32   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 2nd July 2003, 21:22   #2
ramon18
NSIS Dev
 
ramon18's Avatar
 
Join Date: Apr 2003
Location: Portugal
Posts: 110
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
ramon18 is offline   Reply With Quote
Old 3rd July 2003, 17:19   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 3rd July 2003, 22:15   #4
ramon18
NSIS Dev
 
ramon18's Avatar
 
Join Date: Apr 2003
Location: Portugal
Posts: 110
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
ramon18 is offline   Reply With Quote
Old 4th July 2003, 15:49   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 4th July 2003, 16:05   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump