Old 31st October 2002, 10:27   #1
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
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...
Attached Files
File Type: zip system2final.zip (35.7 KB, 282 views)
brainsucker is offline   Reply With Quote
Old 31st October 2002, 19:55   #2
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
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 ;)
brainsucker is offline   Reply With Quote
Old 1st November 2002, 08:43   #3
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Thanks, fixed
Joost Verburg is offline   Reply With Quote
Old 14th November 2002, 18:45   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The compiled System.nsi example doesn't delete Resource.dll. Seems like System.dll doesn't release it.

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 17th November 2002, 09:21   #5
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
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
n0On3 is offline   Reply With Quote
Old 17th November 2002, 22:37   #6
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
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).
Attached Files
File Type: zip system.zip (9.1 KB, 105 views)
brainsucker is offline   Reply With Quote
Old 17th November 2002, 23:57   #7
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
Sorry Kichik, sourceforge was done, so I've noted your changes too late. Here is combined version of our changes... ;)
Attached Files
File Type: zip system.zip (9.1 KB, 110 views)
brainsucker is offline   Reply With Quote
Old 18th November 2002, 14:30   #8
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
"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
n0On3 is offline   Reply With Quote
Old 18th November 2002, 14:35   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
From System.nsi:

PHP Code:
StrCpy $"12312312"
StrCpy $"12345678903"
System::Int64Op $"*" $3
Pop 
$
$4 will contain 12312312 * 12345678903 after this piece of code.

Instead of IntOp you use System::Int64Op and Pop, that's all.

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 18th November 2002, 16:43   #10
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
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?
n0On3 is offline   Reply With Quote
Old 19th November 2002, 11:20   #11
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
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
brainsucker is offline   Reply With Quote
Old 19th November 2002, 18:57   #12
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
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)?
n0On3 is offline   Reply With Quote
Old 19th November 2002, 19:47   #13
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

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 19th November 2002, 20:58   #14
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
Quote:
(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)...
brainsucker is offline   Reply With Quote
Old 22nd November 2002, 23:13   #15
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
and...

is IntCmp implemented for 64bits?
(I need it and can't find a work around )
n0On3 is offline   Reply With Quote
Old 23rd November 2002, 09:08   #16
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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 "-".

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 23rd November 2002, 09:45   #17
brainsucker
Senior Member
 
brainsucker's Avatar
 
Join Date: Sep 2002
Location: Minsk, Belarus
Posts: 190
Send a message via ICQ to brainsucker
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
brainsucker is offline   Reply With Quote
Old 23rd November 2002, 15:25   #18
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
yes! very smart
n0On3 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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