|
|
#1 |
|
Junior Member
Join Date: Oct 2002
Posts: 46
|
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 |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
|
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. - Claudia Pelsmaeker |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2002
Posts: 46
|
Script in question.
|
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
|
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. - Claudia Pelsmaeker |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2002
Posts: 46
|
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 |
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
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.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
|
I meant AFTER the installer tried to copy the mrsystray.exe file, you should write 'SetOverwrite on' again for the next few files.
- Claudia Pelsmaeker |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Oct 2002
Posts: 46
|
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? |
|
|
|
|
|
#9 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
PHP Code:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Oct 2002
Posts: 46
|
Great thanks I'll give this a try.
Melmo |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|