Archive: .onNextPage function ???


.onNextPage function ???
  Hello!

I develop an NSIS installation program and I have not use NSIS for two month and I don't understand why the function .onNextPage and .onPrevPage doesn't work anymore since the Version 2.0.B.0 beacause it's work on the 2.0.a7 ? If those function are realy not usable, could you explain me, please, how can I insert a window (using installOption) between the first and the second windows ?
Thank you in advance for your answere.

I have another question, is somebody can tell me how can I add a "path" in the windows path (for win 98 and win 2000/XP)?

Thank you!!!


There's now a new Page command which controls custom page insertion. Please RTFM.

For your second point please look in the Archive, a simple search for "path" turned this page up.


Thank you for your answere!
for the second point it is good, but for the first ihave to test it but it seems to be good too! So thank You!

I have another problem whit the user variable on the function .onInit??
you can see a simplified part of My script behind:

StrCpy $1 "Section 1"
SectionSetText 1 "$1"
StrCpy $1 "Section 2"
SectionSetText 2 "$1"
StrCpy $1 "Section 3"
SectionSetText 3 "$1"

those lines doesn't work because the user variable $1 keep the last value affected. I explain: All the 3 section appears with "Section3"??? this is like the command SectionSetText take effect at the end of the function??? Somebody can explain me and perhaps help me to find a solution??? This is a bug? or is it normal??

Thank you in advance for your help.


Section text is only processed right before the components page is shown. Therefore it's a bit of a pain to use variables in it. If you set the text right before the components page is shown (components page pre function) then you won't have to worry about variables changing, but you will have to use a different variable for every section text.


Thank you for your quick reply!
I know that but I have 16 section and sudsection so it's means to use 16 Variable only for that. And the problem is that in fact (it is not a simply strcpy) but I use a function that call a dll, pop the top stack value on $1 and do a SectionSetText $2 "$1" (where $2 is the curent section). This function permit to me not to retype those ligne 16 time (and perhaps more!)!!!
If there is no solution i have to supress my function and to write the line 16 Time whith 16 diferents variable? that's right?
ok! Thanks you!


I knew I remembered this question from somewhere... http://forums.winamp.com/showthread....SectionSetText

:D

Anyway, a new idea! You can wait for the components page to show and then set the text (the page's show function). When you set the name when the page is already created the name will be processed immediately (don't worry about the user seeing the change, the show function is called right before the page is shown but after it's created). You will, however, still have to set this everytime the page shows because the section name will be reprocessed when the page is about to show again and then the name will be wrong.


thank a lot for your reply!

It's a good news!!! I know that I have already ask the question but now the function .onNextPage doesn't work so ...
Your suggest seems to be good but I don't find the page's show function on the help? there are the function_Before and Function_After but no Show function??? explain me please because on the function_Before it's doesn't work and on the Function_After it's only work when I click Next and Then I click Back (so it is no usable)?

My new problem (perhaps a bug)is that i try to use the new syntax to call DLL function but it's doesn't work??? In fact I have created a DLL whit some function and when I compile the script there is an error because the compiler doesn't find the function?
During I write this message I test it better and I've sow that it's work properly with the Version 2 b0 but it doesn't work with the 2 b1 CVS Version (updated yesterday) ??? There is some change? (I have already put My DLL on the NSIS plugin directory).

thank you!


It should look something like this:


Page components "" changeNames

>Function changeNames
StrCpy$1 "bla bla"
SectionSetText 0 $1
StrCpy$1 "kasdjlksadjas"
SectionSetText 1 $1
FunctionEnd
>
If you are using the MUI, get the latest CVS version and read the MUI readme to know how to add the show function.

Now for the plug-in. Does the function name appear in the list makensis gives on the top of its output?

At some point in time the order of plugin arguments was reversed... I doubt it but this *might* be something to do with it.


Sorry KICHIK but your suggest it's what I explain in my last post, it's "work" but I have to click on next to go on the folowing page and to click on Back to display corretly the componant page?

For the plug-in I'm sorry but it normal i'm silly!!! In fact I have put my dll on the plugin directory of NSIS 2 b 0 but not on the plugin directory of the CVS version!!!

I'm going to try to use MUI but there is a lot of change to do in my script so i'm not sure to do that without any error!

thank you!


It works for me without going to the next page and back to the components page. Can you please attach the script?


the script
  I send a simplify script which doesn't work (whitout next and back)


The problem is that when the components page is created if the section doesn't have a name it won't create a tree item for it. You see, it thinks it is a hidden section so it doesn't think it should be shown in the components page. Later when you give it a name and it creates the tree again it knows it should be in the tree and there are no problems.

To work this out give all of your dynamically named sections a starting point such as " " (a space) and it will work.


ok thank a lot KICHIK!
I understand what you say and finaly it's normal!!!
Thank you for your help!!!


No problem :D