Old 7th August 2005, 16:40   #41
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
I see your point...


RC4 looks good. Thanks again!
Comperio is offline   Reply With Quote
Old 9th August 2005, 12:38   #42
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Uploaded v0.7.

Added a second parameter to ${myArray->Sort} which can specify another array name. The 2nd array will be rearranged into the same order as the sorted array (works like associative arrays). Both arrays must be of the same size initially.

Added the SetSize function to set the array to a specific size of items.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th August 2005, 12:46   #43
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Uploaded v0.7 RC3.
Minor code changes and readme typo fixes.

-Stu
Afrow UK is offline   Reply With Quote
Old 14th August 2005, 16:11   #44
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Uploaded 0.7 RC4

Added ReadFirst, ReadNext and ReadClose.

-Stu
Afrow UK is offline   Reply With Quote
Old 17th August 2005, 13:00   #45
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Uploaded v0.8

Added IsEmpty, IsFull, IsInRange, and ArrayExists / Inited.

-Stu
Afrow UK is offline   Reply With Quote
Old 26th February 2006, 21:23   #46
SuperPat
Guest
 
Posts: n/a
Hello,

It would be possible to add a function in the array plug-in that erase the elements which appear already in the array?
  Reply With Quote
Old 1st March 2006, 17:15   #47
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
array-pop does not work

Hi Stu

This array-plugin is great! Thank you very much!

With the plugin I would like to pop some values from the array. The value returned was "2" and nothing happened to the array.

Even the provided example did not work. I would be glad, if you could investigate in this.

Thank you very much!

Have a nice Day.

-Bruno.
bholliger is offline   Reply With Quote
Old 1st March 2006, 17:39   #48
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Will look at it now.

-Stu
Afrow UK is offline   Reply With Quote
Old 1st March 2006, 18:01   #49
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Thanks, fixed.
Let me know if you discover any other problems.

http://nsis.sourceforge.net/File:NSISArray.zip

SuperPat:
Use ${myArrayName->Clear}

-Stu
Afrow UK is offline   Reply With Quote
Old 1st March 2006, 18:07   #50
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
Wow great! Thank you very much!

-Bruno.
bholliger is offline   Reply With Quote
Old 16th March 2006, 10:50   #51
ahab282
Guest
 
Posts: n/a
Hey Stu!

Your plugin is really great!
But I have a problem with your script.
For example when executing ${MyArray->Init} there seems to be a value popped from the stack but the function in your plugin doesn't push anything to the stack so the stack is getting emptier!

Some other macros do this too!

I think it's a bug, isn't it!?

-Marcy
  Reply With Quote
Old 28th March 2006, 09:39   #52
Grimace
Junior Member
 
Join Date: Mar 2006
Location: Belgium
Posts: 2
Variable name length

I'm new to NSIS and gratefully using the NSISArray plugin. I stumbled upon an issue which I, by some debugging, tracked down to variable name length of arrays. I'm not sure whether this restriction is by NSIS design, or an NSISArray issue (or just me overlooking something else).

Anyway, when using the following code:

code:

${Array} "TheObject->Foo1_"
${Array} "TheObject->Foo2_"

Section
${TheObject->Foo1_->Init}
${TheObject->Foo2_->Init}
${TheObject->Foo1_->Debug}
${TheObject->Foo2_->Debug}
SectionEnd



you'll only get a debug window for the last initialized array (you can verify that by swapping the 2 Init statements). If you remove the underscore to shorten the variable names, all works fine.

Am I stretching some limits, or is this a bug?
Grimace is offline   Reply With Quote
Old 28th March 2006, 09:57   #53
Grimace
Junior Member
 
Join Date: Mar 2006
Location: Belgium
Posts: 2
Re: Variable name length

Quote:
Originally posted by Grimace

Am I stretching some limits, or is this a bug?
Ok, I took a quick look at the plugin code, and I guess this one's responsible for it:
code:

char arrNames[ARRAY_MAX_COUNT][16];



I think I'll just recompile then
Grimace is offline   Reply With Quote
Old 28th March 2006, 14:31   #54
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I thought I put an error check in for that, but perhaps not.

-Stu
Afrow UK is offline   Reply With Quote
Old 23rd April 2006, 21:42   #55
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Version 1.1 is available for download.

Its most notable change is support for dynamic arrays.
A complete list of changes can be found in the included documentation.

http://nsis.sf.net/File:NSISArray.zip

-Stu
Afrow UK is offline   Reply With Quote
Old 23rd April 2006, 23:11   #56
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
Very interesting...
Thanks AfrowUK!

CF
CancerFace is offline   Reply With Quote
Old 24th April 2006, 23:53   #57
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
I can't wait to test it after my vacation!

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 26th April 2006, 22:03   #58
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
1.2 is now available with some modifications for better error checking.

-Stu
Afrow UK is offline   Reply With Quote
Old 27th April 2006, 13:47   #59
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
Hello

It there a bug with NSISArray 1.2 with the Exists and ExistsI function?

This is a peace of code that add in a array the name of all the directory contained in $SMPROGRAMS (it work well with the version 1.0):

code:
StrCpy $MUI_TEMP2 ""

NSISArray::New /NOUNLOAD "SMProgList"


SetShellVarContext current
FindFirst $UMUI_TEMP3 $MUI_TEMP1 "$SMPROGRAMS\*"
FindNext $UMUI_TEMP3 $MUI_TEMP1
loop:
FindNext $UMUI_TEMP3 $MUI_TEMP1
StrCmp $MUI_TEMP1 "" exit
IfFileExists $SMPROGRAMS\$MUI_TEMP1\* add
goto loop
add:
NSISArray::ExistsI /NOUNLOAD "SMProgList" "$MUI_TEMP1" 0
Pop $MUI_TEMP2
MessageBox MB_OK "$MUI_TEMP1 $MUI_TEMP2"
StrCmp $MUI_TEMP2 -1 0 NoAdd
NSISArray::Push /NOUNLOAD "SMProgList" $MUI_TEMP1
NoAdd:
goto loop
exit:
FindClose $UMUI_TEMP3



Tthe value of $MUI_TEMP2 is curiously allways "4"
Consequently, no items are added in the array


Last edited by SuperPat; 27th April 2006 at 14:22.
SuperPat is offline   Reply With Quote
Old 27th April 2006, 14:10   #60
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
I have found an other problem:

This is a test code:
code:

NSISArray::New /NOUNLOAD "SMProgList"

NSISArray::Push /NOUNLOAD "SMProgList" "a"
NSISArray::Push /NOUNLOAD "SMProgList" "b"
NSISArray::Push /NOUNLOAD "SMProgList" "c"
NSISArray::Push /NOUNLOAD "SMProgList" "d"
NSISArray::Push /NOUNLOAD "SMProgList" "e"
NSISArray::Push /NOUNLOAD "SMProgList" "f"
NSISArray::Push /NOUNLOAD "SMProgList" "g"

NSISArray::Concat /NOUNLOAD "SMProgList" "|"
Pop $UMUI_TEMP3
MessageBox MB_OK "$UMUI_TEMP3"

NSISArray:elete /NOUNLOAD "SMProgList"

NSISArray::Unload



Instead of return "a|b|c|d|e|f|g", it return "4"

Edit: apprently "4" is the error code for the array does not exist


Last edited by SuperPat; 27th April 2006 at 14:34.
SuperPat is offline   Reply With Quote
Old 27th April 2006, 14:26   #61
Filus
Junior Member
 
Join Date: Feb 2006
Location: Pomerania
Posts: 16
In the new versions (1.1 and 1.2) Write function has a bug when it is writing to the last element. It's creating new "empty" element or "undeleting" one of previosuly deleted.
Filus is offline   Reply With Quote
Old 27th April 2006, 20:17   #62
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Thanks Filus, this problem has been fixed in the new version. The problem also appeared in three other functions while I was making modifications between 1.1 and 1.2.

v1.3 is now available for download from the same location.

Please note:
If you have a previous release of NSISArray installed, please delete the Contrib\NSISArray and Examples\NSISArray folders before installing the new release.

SuperPat:
Sorry I hadn't updated the information on the New function.
It now requires two extra parameters.

-Stu
Afrow UK is offline   Reply With Quote
Old 27th April 2006, 21:34   #63
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
Quote:
Sorry I hadn't updated the information on the New function.
It now requires two extra parameters.
Yes But:
code:

NSISArray::New /NOUNLOAD "SMProgList" 7 1

NSISArray::Push /NOUNLOAD "SMProgList" "a"
NSISArray::Push /NOUNLOAD "SMProgList" "b"
NSISArray::Push /NOUNLOAD "SMProgList" "c"
NSISArray::Push /NOUNLOAD "SMProgList" "d"
NSISArray::Push /NOUNLOAD "SMProgList" "e"
NSISArray::Push /NOUNLOAD "SMProgList" "f"
NSISArray::Push /NOUNLOAD "SMProgList" "g"

NSISArray::Concat /NOUNLOAD "SMProgList" "|"
Pop $UMUI_TEMP3
MessageBox MB_OK "$UMUI_TEMP3"

NSISArrayelete /NOUNLOAD "SMProgList"

NSISArray::Unload


even with the 2 parameters, this code don't work
the string is empty...
What is wrong in my code?

SuperPat is offline   Reply With Quote
Old 27th April 2006, 22:01   #64
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You forgot (or perhaps didn't know) that C strings have a NULL character on the end of them (/0) which specifies the end of the string.

I should put a note about this in the documentation, but the minimum string length is 2 not 1.

If you get any other problems, use NSISArray::ErrorStyle /NOUNLOAD 2 or 4 to find out what error is being produced.

-Stu
Afrow UK is offline   Reply With Quote
Old 28th April 2006, 11:26   #65
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
Even by putting 10 15 like parameters, the string of exit remains always equal to 0

code:

NSISArray::New /NOUNLOAD "SMProgList" 10 15

NSISArray::Push /NOUNLOAD "SMProgList" "e"
NSISArray::Push /NOUNLOAD "SMProgList" "f"
NSISArray::Push /NOUNLOAD "SMProgList" "g"
NSISArray::Push /NOUNLOAD "SMProgList" "a"
NSISArray::Push /NOUNLOAD "SMProgList" "b"
NSISArray::Push /NOUNLOAD "SMProgList" "c"
NSISArray::Push /NOUNLOAD "SMProgList" "d"

NSISArray::Sort /NOUNLOAD "SMProgList" ""

; Build the list
NSISArray::Concat /NOUNLOAD "SMProgList" "|"
Pop $0
MessageBox MB_OK "$0"



My other example gives the same result

SuperPat is offline   Reply With Quote
Old 28th April 2006, 11:30   #66
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I can't test the script here at college but when I get home I will do so (6 hours from now).

-Stu
Afrow UK is offline   Reply With Quote
Old 28th April 2006, 11:35   #67
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
I see with the debug window that the Push and the Sort functions work, but the Concat function return always "0"

SuperPat is offline   Reply With Quote
Old 28th April 2006, 11:36   #68
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I have identified the problem. It's a problem in the DLL. I'll fix it when I get home. There is also a problem with the script header which I need to fix.

-Stu
Afrow UK is offline   Reply With Quote
Old 28th April 2006, 17:54   #69
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Please try v1.3 RC3:
http://nsis.sourceforge.net/File:NSISArray.zip

-Stu
Afrow UK is offline   Reply With Quote
Old 28th April 2006, 21:00   #70
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
This version work fine.
SuperPat is offline   Reply With Quote
Old 29th April 2006, 22:30   #71
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
A few suggestions for the docs whenever you happen to add/change something else:[list=1][*]Sometimes it's hard to remember if an array starts with element "0" or element "1". (I know the norm is to have zero-based arrays, but I use scripting languages that work both ways, so sometimes I just get confused...) It might be helpful to have this stated somewhere in the beginning of the docs.
[*]The function ${Array->Write} allows you to overwrite elements. It's made clear in the docs that the ${Array->Put} command DOES NOT overwrite existing values, but it does not mention in the docs for the ${Array->Write} command that it WILL overwrite values.[/list=1]

PS: I just have to say how extremely useful your plugin has been for me! I use it every chance I get!

Last edited by Comperio; 30th April 2006 at 01:00.
Comperio is offline   Reply With Quote
Old 29th April 2006, 23:03   #72
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Thanks Comperio I shall add some notes to the documentation for next release.

-Stu
Afrow UK is offline   Reply With Quote
Old 1st May 2006, 22:57   #73
Pharaoh Atem
Junior Member
 
Join Date: Feb 2006
Posts: 35
The latest NSISArray plugin freezes my installer... I had to revert to the version that I have that uses the .NET Framework...
Pharaoh Atem is offline   Reply With Quote
Old 2nd May 2006, 14:32   #74
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It would be more helpful if you could identify what exactly freezes the installer (e.g. which plugin function).
Perhaps you could create an example which reproduces the problem.

Did you make sure you extracted all the plugin files from the Zip? You can't expect to use the new plugin if you don't extract the new script header as well for example.

-Stu
Afrow UK is offline   Reply With Quote
Old 2nd May 2006, 22:44   #75
Pharaoh Atem
Junior Member
 
Join Date: Feb 2006
Posts: 35
I am using Component Manager, which utilizes the NSISArray plugin, and comes with it... It turns out a special build is required to use it with Component Manager... Unfortunately, neither I nor dandaman32 have VC6, but we had C::B, but I don't have a clue how to dynamically link to the VC6 library using MinGW... So, it was statically linked... If it could be dynamically linked to the VC6 DLL using MinGW, that would be good, because my installer blew up 120K for including a statically linked version...
Pharaoh Atem is offline   Reply With Quote
Old 2nd May 2006, 23:00   #76
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I guess the special build was made for custom array sizes. Since NSISArray 1.0, arrays are now dynamic and so special builds are not needed.

I haven't seen dandaman32 around for a while, so he may not know about the new version. To use the new plugin, major changes are needed on old scripts.

-Stu
Afrow UK is offline   Reply With Quote
Old 27th July 2006, 00:14   #77
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
Hello,

I have a problem with NSISArray, To be more precise, with the Concat function:

I wish to create a MULTILANGUAGE page for UltraModernUI.

I have a variable named $UMUI_LANGLIST that contain all the names of the language inserted in the NSIS script.
Example:
"English|Français|Português (do Brasil)|Deutsch|Español|Chinese (Simplified)|Chinese (Traditional)|Japanese|Korean|Italiano|Nederlands|Danish|Svenska|Norwegian|Suomi|Greek|Russian|Português|Polski|Ukrainian|Cesky|Slovensky|Hrvatski|Bulgarian|Magyar|Thai|Romana|Latvieðu|Macedonian|Eesti keel|Türkçe|Lietuviu|Català|Slovenski jezik|Serbian Cyrillic|Serbian Latin|Arabic|Farsi|Hebrew|Indonesian|Mongolian|Lëtzebuergesch|Albanian|Brezhoneg|Byelorussian|Icelandic|Malay|Bosanski|Kurdî|Euskera|Welsh|Irish"
Its StrLen is 499


The goal of this code is to sort the language list:

code:
StrLen $R0 $UMUI_LANGLIST ; $Ro = 499
; create an array that containing the langstring
NSISArray::New /NOUNLOAD "LangList" 55 8

NSISArray::WriteListC /NOUNLOAD "LangList" "$UMUI_LANGLIST" "|"

NSISArray::Sort /NOUNLOAD "LangList" ""

NSISArray::Concat /NOUNLOAD "LangList" "|"
Pop $UMUI_LANGLIST

StrLen $R1 $UMUI_LANGLIST ; $R1 = 392 Only....
NSISArray::Debug /NOUNLOAD "LangList" ; The array contain well all the 52 items

MessageBox MB_OK "$R1 instead of $R0" ; ===> 392 instead of 499 bytes returned



The array contain well all the 52 items but when I want to get the list with the Concat function, it return only the 41 first items...

Why NSISArray has not returned the others items?

SuperPat is offline   Reply With Quote
Old 27th July 2006, 00:42   #78
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I'll look into this tomorrow morning as soon as possible. It's getting late here

-Stu
Afrow UK is offline   Reply With Quote
Old 27th July 2006, 11:26   #79
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Thanks, fixed.
http://nsis.sourceforge.net/File:NSISArray.zip

-Stu
Afrow UK is offline   Reply With Quote
Old 27th July 2006, 12:42   #80
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
Work fine, Thanks

SuperPat 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