- NSIS Discussion
- Help with a script (Sections problem)
Archive: Help with a script (Sections problem)
lars1106
8th August 2006 10:33 UTC
Help with a script (Sections problem)
Not beeing a programmer - I could need some help with a script (enclosed)
I need to have 1 mandatory section, which is the program and then 2 sections of which only 1 can be choosen.
I have been looking in developer center and tried the section examples there, but I fail.
As it is now you can select and deselect all sections - which is not good, most users will install everything resulting in the correct files will be overwritten.
I hope someone can help and modify the script - I have given up and gone back to marketing where I belong ;)
Thanks in advance for any assistance/modification
Best regards
Lars
Afrow UK
8th August 2006 11:37 UTC
1. Put "SectionIn RO" inside the Section.
2. See Examples\one-section.nsi
-Stu
lars1106
8th August 2006 13:32 UTC
Stu,
Thanks for your swift answer, looked at "one-section" example, however this deals with only 1 section selected, I need 2.. The main program, and then 1 section out of a few.
Wbr
Lars
Afrow UK
8th August 2006 13:49 UTC
You use RadioButtons on the two that need only one selection, ommiting your read only section.
-Stu
lars1106
8th August 2006 15:19 UTC
Hi Stu
I have tried, but I must admit that I cannot implement this. Have you possibility of implementing your ideas into the script I enclosed in the beginning?
I hope this is not too much to ask, I seem to be stuck.
Thanks
Lars
Afrow UK
8th August 2006 15:28 UTC
It is very straight forward.
-Stu
lars1106
8th August 2006 15:55 UTC
Stu,
I have been trying to implement this in the script (enclosed) But now I run into some syntax problems with:
Function: ".onInit"
Error: Function named ".onInit" already exists.
Error in script "C:\Programmer\NSIS\stu.nsi" on line 599 -- aborting creation process
Since this is allready defined in line 56 and when I comment this out another error occurs
Lars
lars1106
8th August 2006 16:03 UTC
Forgot the attachment
Afrow UK
8th August 2006 16:13 UTC
You can't have two Functions with the same name.
-Stu
lars1106
8th August 2006 16:29 UTC
Thanks...
I use the modernUI, and I can see that the example you gave is classic.
While the classic example compiles OK, I get this error in my script:
!Insertmacro: macro named "StartRadioButtons" not found
Is this related to the modernUI?
lars1106
8th August 2006 16:34 UTC
Oh.. got it... I forgot to include "sections.nsh"
Thanks Stu
Afrow UK
8th August 2006 16:56 UTC
You can convert the code to use Modern UI with minimal changes. If you need help, let us know.
-Stu
lars1106
8th August 2006 17:08 UTC
Hi Stu..
Looks like it works now, also with the ModernUI. I get a warning:
Install function ".Oninit1" not referenced zeroing code.
But it works.. I enclose it. thanks for your swift assistance.
Lars ;)
Afrow UK
8th August 2006 17:10 UTC
You've got this:
Function .onInit1
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
This code will never be executed.
You need to move its contents to the other .onInit Function and delete this Function.
-Stu
lars1106
8th August 2006 17:32 UTC
Got it... Works like a charm