Winamp Forums

Winamp Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   SetOverwrite installation time (http://forums.winamp.com/showthread.php?t=374201)

helpmepl0x43 15th December 2013 13:22

SetOverwrite installation time
 
I was thinking of using SetOverwrite to have the installer skip installing files which already exist in the destination directory... this is to save the user some time because I have a few fairly large files, so I don't want it unnecessarily overwriting large files that already exist.

But there's this problem with SetOverwrite.

If I'm installing a bunch of files with SetOverwrite ifdiff (overwrite only if older/newer), eg:
code:

SetOverwrite ifdiff
File X
File Y



Let's say File X is 500mb, File Y is 1kb.
The destination folder already has an identical File X, but a different File Y.

Thus File X would get skipped, but File Y would be overwritten.

But here's what happens:
File X gets skipped - now that's about 15-20 seconds saved.
But when it comes to overwriting File Y, it then spends that saved 15-20s of install time to overwrite this measly 1kb file!!

This makes no sense to me! Am I missing something here?


I'm still relatively inexperienced at NSIS, so could someone suggest an alternative for overwriting files if they are found to be older/newer than the ones being installed?

Thanks
----------------
Edit:

I find that placing the SetOverwrite and large file at the very end of the script works fine (it installs Y quickly, and skips X as intended):
code:

File Y
SetOverwrite ifdiff
File X



But this doesn't help when you have multiple large files.

JasonFriday13 16th December 2013 00:39

Perhaps the installer is having to seek past the big file in the datablock and that's what is taking so long, so I would suggest ordering your 'File' commands a little so that the biggest files are last in the datablock (files are added to the datablock in the same order as in your script, which is why putting those commands at the end of your script works better).


All times are GMT. The time now is 00:57.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.