Old 4th August 2003, 14:34   #1
bSecRes
Junior Member
 
Join Date: Jul 2003
Location: LA USA
Posts: 37
I used #define NSIS_MAX_STRLEN 8192 in config.h and compiled with MS VC++. When I !insertmacro MUI_INSTALLOPTIONS_Read, only 1024 characters are on stack. Is there something in installoptions I need to change as well?

Edit:
Opening the ini file shows the whole string (>1024) is in the state field... this is a listbox.
Edit again: listitems not state, actual line is:
!insertmacro MUI_INSTALLOPTIONS_Read $R6 "Myini.ini" "Field $R0" "ListItems"

Last edited by bSecRes; 4th August 2003 at 14:51.
bSecRes is offline   Reply With Quote
Old 4th August 2003, 14:37   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
What's the value of ${NSIS_MAX_STRLEN}?

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 4th August 2003, 14:51   #3
bSecRes
Junior Member
 
Join Date: Jul 2003
Location: LA USA
Posts: 37
8192 and I'm actually only seeing 1019 characters on stack.
bSecRes is offline   Reply With Quote
Old 4th August 2003, 19:19   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You are using the latest CVS version right? From what date?

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 4th August 2003, 19:23   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I will try out my makensis copy once I have a response from other topic.
I also have a custom page with a ListBox control which I can test on.

This may help:
code:
Function TestStrLen
Push $R0
Push $R1
StrCpy $R0 ""
loop:
StrCpy $R0 "$R0|a"
StrLen $R1 $R0
StrCmp $R1 8192 0 loop
WriteINIStr "$TEMP\ddayupdates\dialog.du" "Field 3" "ListItems" "$R0"
ReadINIStr $R1 "$TEMP\ddayupdates\dialog.du" "Field 3" "ListItems"
StrCmp $R1 $R0 0 +3
StrCpy $R0 "test success"
Goto exit
StrLen $R1 $R0
StrCpy $R0 "test fail: only $R1 strlen"
exit:
Pop $R1
Exch $R0
FunctionEnd



If $R0 is "test success" then the str of 8192 strlen was copied and retreaved from the ini file successfully.
Else, "test fail: only $R1 strlen" with $R1 being the strlewn of retreaved str.

Btw, on Win9x there are apparently limitations to strlen in the file?

-Stu
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 20:35   #6
bSecRes
Junior Member
 
Join Date: Jul 2003
Location: LA USA
Posts: 37
Mon Aug 4 05:51:34
This is on a W2K server.
bSecRes is offline   Reply With Quote
Old 4th August 2003, 20:46   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Works for me... Can you try the attached example (compiled version and a version you compile yourself) and also attach your test case?
Attached Files
File Type: zip inilong.zip (19.7 KB, 185 views)

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 4th August 2003, 23:07   #8
bSecRes
Junior Member
 
Join Date: Jul 2003
Location: LA USA
Posts: 37
Argh. The reason it appeared that the value was getting chopped was because of dumpstate. Dumpstate is compiled at 1024 -5 apparently. The reason why the later values in my list were not being removed is because the values had invisible EOL characters appeneded to them that caused the StrStr match to fail. Thanks for the help anyway. Gosh this was hard to troubleshoot.

I'm attaching my sample script anyway; comments welcome.
Attached Files
File Type: zip blablabla.zip (45.7 KB, 200 views)
bSecRes is offline   Reply With Quote
Old 7th August 2003, 17:43   #9
Andrew Francis
Junior Member
 
Join Date: Feb 2003
Location: Perth, Western Australia
Posts: 8
Gah, sorry if it's Dumpstate's fault.

Dumpstate is passed the maximum string length by NSIS, and barely uses it - Dumpstate just uses the NSIS buffers except when editing a string, where it will throw loud error messages at you if things get too long.

But it sounds like there's a bug in there somewhere. I'll take a look as soon as I get the time (probably in about a day).

Unless: is it possible that you've recompiled makensis but not the exehead stub, in which case the stock exehead will tell Dumpstate that maximum string length is 1024? (Somewhat doubtful, as I expect you'd end up crashing somewhere if this was the case).
Andrew Francis is offline   Reply With Quote
Old 7th August 2003, 18:20   #10
bSecRes
Junior Member
 
Join Date: Jul 2003
Location: LA USA
Posts: 37
I loaded the project in MS VC++ 6 and did a build all. Thanks for helping out though. Dumpstate is invaluable.
bSecRes is offline   Reply With Quote
Old 10th August 2003, 15:57   #11
Andrew Francis
Junior Member
 
Join Date: Feb 2003
Location: Perth, Western Australia
Posts: 8
Ok, think I've got it nailed. Turns out the problem is wsprintf (the sprintf built into kernel32.dll) not being able to write out more than about 1024 bytes. Of course, I figured this out after I restructured things to build the copy-to-clipboard string from the original data, rather than just reading everything out of the listbox - I thought the listbox was truncating stuff.

Anyway, give this a go. Once I've actually tested it properly I'll update the dumpstate homepage and the NSIS archive.
Attached Files
File Type: zip dumpstate-0.2.zip (15.9 KB, 172 views)
Andrew Francis is offline   Reply With Quote
Old 12th August 2003, 22:09   #12
bSecRes
Junior Member
 
Join Date: Jul 2003
Location: LA USA
Posts: 37
Sorry for the slow reply, it works great! Thanks a ton, this is an essential tool.
bSecRes is offline   Reply With Quote
Old 12th August 2003, 23:23   #13
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
I've updated the archive copy of dumpstate to 0.2.
Sunjammer 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