Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 22nd January 2003, 08:19   #1
mrtech
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
mrtech is offline   Reply With Quote
Old 22nd January 2003, 09:42   #2
virtlink
Major Dude
 
virtlink's Avatar
 
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.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 22nd January 2003, 09:49   #3
mrtech
Junior Member
 
Join Date: Oct 2002
Posts: 46
Script in question.
Attached Files
File Type: nsi mrsystray.nsi (6.7 KB, 88 views)
mrtech is offline   Reply With Quote
Old 22nd January 2003, 10:12   #4
virtlink
Major Dude
 
virtlink's Avatar
 
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.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 22nd January 2003, 13:57   #5
mrtech
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
mrtech is offline   Reply With Quote
Old 22nd January 2003, 14:00   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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
kichik is offline   Reply With Quote
Old 22nd January 2003, 14:01   #7
virtlink
Major Dude
 
virtlink's Avatar
 
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.

"I'll quote you when you say something memorable."
- Claudia Pelsmaeker
virtlink is offline   Reply With Quote
Old 22nd January 2003, 14:04   #8
mrtech
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?
mrtech is offline   Reply With Quote
Old 22nd January 2003, 14:09   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
PHP Code:
againClearErrors
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.

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
Old 22nd January 2003, 14:13   #10
mrtech
Junior Member
 
Join Date: Oct 2002
Posts: 46
Talking

Great thanks I'll give this a try.

Melmo
mrtech is offline   Reply With Quote
Reply
Go Back   Winamp 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