- NSIS Discussion
- system: second release - final
Archive: system: second release - final
brainsucker
31st October 2002 11:27 UTC
system: second release - final
Ok. I've completed examples, but documentation is still in bad condition (any help will be apreciated :).
Examples included: Indirect message boxes (with custom icons etc), Int64 ops, Disk space etc, Structures, GetFileSysTime, and ... SPLASH :) callbacks are working ;)
Changes from prerelease version:
1. Inline input into structures bug fixed.
2. Zero values for structure special options bug fixed.
3. &lN for structures - automatic size detection - added.
4. Automatic callback queue clear up (so no /CALLBACK required for System::Free now).
5. System::Store - store/restore registers and pop/push registers.
6. '\' is no more an escape character for inline input. If you need to place the
same quotes into input as you used for separation of input expression just use
these characters in doubled way. For example (t "just an ""Example""!").
P.S. I've created an additional dir in contrib/system since there are many source files and it's hard to find textual contribs otherwise. Sorry to makensis.nsi updater :)
P.P.S. Examples/System.nsi contains examples :)
P.P.P.S. I'm to busy to adopt vc6 project file now, sorry...
brainsucker
31st October 2002 20:55 UTC
There is a small update required since you changed file/directory paths:
system.nsi: replace
!include "${NSISDIR}\Contrib\System\Additionals\sysfunc.nsh"
with
!include "${NSISDIR}\Contrib\System\sysfunc.nsh"
SysFunc.nsh: replace
!include "${NSISDIR}\Contrib\System\Additionals\System.nsh"
with
!include "${NSISDIR}\Contrib\System\System.nsh"
sorry ;)
Joost Verburg
1st November 2002 09:43 UTC
Thanks, fixed :D
kichik
14th November 2002 19:45 UTC
The compiled System.nsi example doesn't delete Resource.dll. Seems like System.dll doesn't release it.
n0On3
17th November 2002 10:21 UTC
I downloaded this file and the latest CVS but it won't compile. Anyway, what I wanted to know is if that "int64" means that I can use integers of 64 bits in nsis. if the answer is yes: how?
thanks
brainsucker
17th November 2002 23:37 UTC
Kichik: added FreeLibrary call to systemMessageBox, thanx. Modified examples attached. Also resource.dll link updated - now compiles fine.
btw: NSIS never deletes System plugin too :) May be it should delete all used plugins at final (i found my Temp dir fillled with 8 mb of system.dll in different nsis folders ;) ?
noon: see Int64Op function. Search for the 'Int64Op' string files located at Contrib\System folder: system.txt and system.nsi.
P.S. System is already included into NSIS distribution (at least CVS version).
brainsucker
18th November 2002 00:57 UTC
Sorry Kichik, sourceforge was done, so I've noted your changes too late. Here is combined version of our changes... ;)
n0On3
18th November 2002 15:30 UTC
"could be a hard barrier for non Win32 programmers"
ok, I am not a win32 programmer. Could you tell me what do I need to change to work with integers of 64bits? I want to add, divide and write to files.
Thanks
:)
kichik
18th November 2002 15:35 UTC
From System.nsi:
StrCpy $2 "12312312"
>StrCpy $3 "12345678903"
>System::Int64Op $2 "*" $3
Pop$4
>
$4 will contain 12312312 * 12345678903 after this piece of code.
Instead of IntOp you use System::Int64Op and Pop, that's all.
n0On3
18th November 2002 17:43 UTC
Thanks I think it works.
btw, not using the intop64 takes 16 seconds an installation to work, and using it takes 52. is this normal?
brainsucker
19th November 2002 12:20 UTC
SUUUCK! I've typed two pages of answer :)) and that damn IE eated it all after I pressed Backspace by the case. sux.
Ok. Short answer: Calls to external plugins and int64 arithmetic are time consuming oops. check for unload option, in case of many system:: calls this could be the reason.
at script start should be:
setpluginunload manual
at script end should be (at line which will be executed last or so):
setpluginunload alwaysoff
System::Free 0 ; actually does nothing
n0On3
19th November 2002 19:57 UTC
well, I didn't understand fully. But I will add this "setpluginunload manual" in the very beginning, and this "setpluginunload alwaysoff" at the very end (I forget the other line as it does nothing).
As I have sections and functions, do I need to put this in every section or function, or just in the first line of the first section and the last line for the last section (as functionas are called from sections)?
kichik
19th November 2002 20:47 UTC
Right before you use System.dll for the first time and the second one right before you use it for the last time.
It takes longer because NSIS has to load the DLL everytime, and that takes some time. If you tell it not to unload the DLL it will be a bit shorter.
brainsucker
19th November 2002 21:58 UTC
(I forget the other line as it does nothing).
;) It does nothing but you shouldn't forget it :) The system plugin couldn't free the zero, so it will do nothing, but the NSIS don't know this. By the other hand we are turning plugin unload back (always off state), so the plugin will be finally unloaded and deleted successfully after instalation end.
Kichik described the other way (it is right too): you could find the last use of system plugin and set this option (plugin unload) right before it.
2 Kichik: may be we should find easier way to do this? ;) This could be some statement which will compile into the same call (the same compiled entry) to unexistant function of plugin but with unload turned on (so no exehead size consumption)...
n0On3
23rd November 2002 00:13 UTC
and...
is IntCmp implemented for 64bits?
(I need it and can't find a work around:D )
kichik
23rd November 2002 10:08 UTC
If you just want to see if they are equal you can use IntOp64 <#1> - <#2> and compare the result to "0". If you want a bit more, you can compare the first char to "-".
brainsucker
23rd November 2002 10:45 UTC
Kichiks way will work too, but ... RTFM (system.txt ;)
----------------------------------
System::Int64Op ARG1 OP1
System::Int64Op ARG1 OP2 ARG2
----------------------------------
Performs operation on ARG1 and ARG2 (or on ARG1 only at single argument operator cases) and returns result on stack. Here are the OP2s: +, -, *, / DIV, % MOD, | OR, & AND, ^ XOR, || LOGIC-OR, && LOGIC-AND, < BELOW, > ABOVE, = EQUAL.
There are only 2 OP1s: ~ (BITWISE-NOT) and ! (LOGIC-NOT).
So, use:
System::Int64Op 234563524532 < 7236487463264
Pop $0
Strcmp $0 0 labelFirstIsNotSmaller labelFirstIsSmaller
n0On3
23rd November 2002 16:25 UTC
yes! very smart :winamp: