Prev Previous Post   Next Post Next
Old 20th November 2008, 23:34   #1
forbjok
Junior Member
 
Join Date: Nov 2002
Posts: 5
Question Local variables / Passing variables to functions

Hi.

I use NSIS quite a lot for various installers and updaters, and it works excellently for doing common installer tasks such as installing/copying files, making registry changes and creating shortcuts.

Combined with custom NSI script generator software I've written to generate scripts, it's a major improvement over any previous commercial installers I've used.

However, any time the need arises to do more than just simple file operations in the NSI script some lack of basic features in the scripting language become painfully obvious.

I am of course referring to the lack of support for local variables in functions, and the inability to pass variables directly to functions (like "myfunction(var1, "string", 5)").
I'm well aware that nothing is really impossible - most things can be done using the assembly-like stack system, with push/pop/exch.

The problem is that this generally results in very large functions that consist 90% of push/exch/pop statements in order to get any needed arguments and preserve the global variables through the function. (to see what I mean, just take a look in the standard includes that come with NSIS - though I'm sure anyone who has used NSIS for some time will know what I'm talking about immediately)
This extends to such a degree that when more advanced operations need to be done it will often be easier to simply write a full-fledged program in another programming language and have NSIS run the compiled executable during installation.

Basically, I'm wondering if there is any chance support for these things will ever be added to the scripting language.

It would really be a major improvement, and would simplify things greatly when performing more advanced tasks in NSIS.
forbjok is offline   Reply With Quote
 
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