Skip to content
⌘ NSIS Forum Archive

2 .OnInit functions

10 posts

jimpy22#

2 .OnInit functions

Hi, I have created an installer that uses a custom components page (from one-section.nsi) and a custom page that allows user variables to be written into an .ini file. Both use a function called .OnInit which obviously are not allowed in the same installer. I have tried to change the function name which does not help and I have searched the forum for a similar problem. Can any one help with this?

Thanks
glory_man#
As I have understood you in different .onInit-functions try to make different actions. Can you make these actions in one function called .onInit?
Yathosho#
if i understood your problem correctly, you should try to use seperate functions and call them from the oninit function. if i'm entirely misunderstanding you, attaching your script might be of help.
Afrow UK#
Keep one as .onInit, rename the other to .onInit2 and out Call .onInit2 in your first .onInit function 😛

Or you could copy the code from .onInit2 and put it in .onInit as glory_man rightly said.

-Stu
jimpy22#
I have got the two functions together in the .Oninit which now works, but I have 3 fields in my ioa.ini and only 2 are showing in the actual installer when I run it - can anyone tell me why?

Thanks. (I have attached .nsi file and .ini file)