Archive: SetOverwrite, IfErrors & File space calculation issue


SetOverwrite, IfErrors & File space calculation issue
  I've been trying to get this working for a little while now and here is what I've come up with:

Situation:
- my VB app downloads and runs nsis installer via shellexecute as an upgrade
- installer/app have a timing issue and needs the first error "Can't Overwrite" msg back in order for the app to finish the shellexecute and unload itself

Fix:
SetOverwrite try

File mrsystray.exe ; might still be in use or unloading

IfErrors 0 NoError
Sleep 100
File mrsystray.exe
NoError:

Problem:
Though the installer is still very small, the required file space is reported as doubled of what you really need.

Question:
Is there anyway of adding a /dontadd or /ignoresize to the File command or like with the AddSize add a SubstractSize

In the meantime I'm using AddSize -252 but the size of my app changes from build to build. Tried using the FileSizeNew script but it returned the amount in bytes and could really get it to compile.

Any suggestions would be grateful, thanks.

Mel


Since AddSize -252 does propably exactly the same as SubstractSize would do, I assume that you want disable that NSIS calculates the size of the files and then add the real size.

By the way, maybe it's a bug that NSIS reports more bytes than it should have. Please post your script as an attachment for reviewing.


Script in question.


I can't find any errors, maybe KiCHiK can.
But don't forget to reset the SetOverwrite with 'SetOverwrite on' after you have copied the problem-file.


Basically if I had overwrite on, it would hang, then it would timeout prompting to abort/retry/fail, remember mrsystray.exe is calling the installer waiting for a shellexecute return code (finished, timedout, error) and then it will proceed, now since it timesout generating an error my app proceeds to unload itself, allowing the IfErrors to take over and replace the exe.

But I do agree that the file space used is a bug or could be remedied by adding a /dontcalcsize or something to the File command.

Thanks,

Mel


When you extract the file twice it will take twice the space, no bug or error there. You can either make it in one loop, put the second file command in a function or use the dynamic compiling from the FAQ.


I meant AFTER the installer tried to copy the mrsystray.exe file, you should write 'SetOverwrite on' again for the next few files.


Can you point me to an example of a loop?

I'll set it back to on thanks.

Also where can I get an FAQ on how to use the Modern stuff?



again: ClearErrors

File mrsystray
.exe
IfErrors 0 NoErrors
Sleep 500
Goto again
NoErrors
>
There is no FAQ about the MUI yet, but if you ask here someone will surely answer you.

Great thanks I'll give this a try.

Melmo