Archive: Functions


I'm having difficulty finding enough examples and documentation for things I want to do in the installer. Can other functions be called from .onInit? When creating functions, when do you have to save registers, and which registers need to be saved? How do you handle parameter passing in function calls?


You can call other functions from .onInit using Call.

Normally, it's a good idea to save registers you'll be using. To do that, there's Push, Pop and Exch. Same goes to passing parameters to functions. Nearly every function on the Wiki has stack code you can use as an example.

There's also:

http://nsis.sourceforge.net/Pop%2C_P...h..._The_Stack
http://nsis.sourceforge.net/Macro_vs_Function