Old 19th April 2007, 12:49   #1
Chappe
Junior Member
 
Join Date: Apr 2007
Posts: 1
Dynamic variable for use with InstTypeSetText

Is there any way to declare or use arrays (as in C/C++), because InstTypeSetText needs a variable. This global setup will read installtypes (1..100) from ini-file.
I know there are a NSISArray, but can't use it with InstTypeSetText

Some of the code I want to fix:

Var varSetupTypes[100] <--- Will not work in NSIS


StrCpy $varSetupIndex 0
LoopSetupTypes_Begin:
Push $varSetupIndex

Call Function_ReadSetupTypeData

${If} $varSetupIndex = 100
Goto LoopSetupTypes_End
${EndIf}

IntOp $varSetupIndex $varSetupIndex + 1
Goto LoopSetupTypes_Begin
LoopSetupTypes_End:

Function Function_ReadSetupTypeData

Var /GLOBAL varType

Pop $0 //1st time it's 0, 2nd it's 1 and so on

StrCpy $varType ${defIniFile_Type}$0

ReadINIStr $varSetupTypes[$0] ..\setup.ini "Setup Types" $varType

InstTypeSetText $0 $varSetupTypes[$0]

FunctionEnd

We have a working global setup in InstallShield, but we want to move to NSIS.

Last edited by Chappe; 19th April 2007 at 13:09.
Chappe is offline   Reply With Quote
Old 19th April 2007, 17:26   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Nope, no array support. You'll have to use a custom page to display the combo box or wait for the InstTypeSetText issue to be resolved.

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
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