Archive: Just add 1 botton to a nsDialogs page


Just add 1 botton to a nsDialogs page
  I Have been searching for 2 days now for a way to do what I guess is a simple thing.

I Am sorry to say that I have lost me rag. And now give up. :igor:

I Wish to add one button to a nsDialog page. But I am at a lost now as to how to do it.

I Have my installer all working just as I want it. But on this page (page 4 in my setup) I wish to add a button that when clicked will execute a function (it will do a ExecWait). I Only need the one button on this page. I Don't care where the button is. I Just wish for it to be there.


http://oddsodz.com/dump/prpost/prspash6.jpg


So somewhere in the "Function nsDialogsMumble" part of my .nsi file I need to add some code. But everything I have tried has failed ;(

I Hope somebody can take a look and tell me what I am missing (apart from a brain).

Oddsodz


I'm not sure if the person who wrote this actually read the nsDialogs documentation...

nsDialogs::CreateButton 

>
CreateButton is not a function inside nsDialogs... if going by the rest of the statements in that script, it would have to be something like:

nsDialogs::CreateControl BUTTON ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${WS_TABSTOP} "" 120u -32u -130u 16u "Button!" 

What you might have been thinking of is the much friendlier macro/define form, though:
${NSD_CreateButton} 120u -32u -130u 16u "Button!" 
Edit: for pointers as to how you might use those macro/defines for the rest of that dialog, see: http://www.pastebin.ca/1959339 (expires in 3 days).

You sir. Need a big cookie. I Found out where I was going wrong.

!include "nsDialogs.nsh" was not in my .nsi

I Feel so silly but with much relief. I Really was pulling my hair out.

Thank you so very VERY much.


You should be using MUI2.nsh not MUI.nsh. MUI uses Install Options. MUI2 uses nsDialogs.

Stu


I Don't care now. It works as it should. I Am more than happy.

Thanks guys.


You should care because it means it's bundling Install Options as well as nsDialogs. Just change the single !include line to MUI2.nsh (it should be that simple in your case).

Stu


You should care because it means it's bundling Install Options as well as nsDialogs. Just change the single !include line to MUI2.nsh (it should be that simple in your case).

Stu


I Thank you for looking out for me. But as I am a noob in such things. Why would it matter? Right now. It works as I need it to.

I did try the change.

And it spat out a load of errors. All that could be ignored and the installer still worked as it should. So I am at a lost as to why I should change. I Am a firm believer in "If it's not broke. Don't fix it".

Please don't look at this post as a bad thing. I Am a noob. So I will need a noobs guides in such matters.

Thanks

EDIT.

Here is the error

  unknown variable/constant "mui.ComponentsPage.DescriptionText" detected, ignoring (macro:MUI_DESCRIPTION_BEGIN:4)

unknown variable/constant "mui.ComponentsPage.DescriptionText" detected, ignoring (macro:MUI_DESCRIPTION_BEGIN:5)
unknown variable/constant "mui.ComponentsPage.DescriptionText.Info" detected, ignoring (macro:MUI_DESCRIPTION_BEGIN:6)
unknown variable/constant "mui.ComponentsPage.DescriptionText" detected, ignoring (macro:MUI_DESCRIPTION_BEGIN:6)
unknown variable/constant "mui.ComponentsPage.DescriptionText" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:6)
unknown variable/constant "mui.ComponentsPage.DescriptionText" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:7)
unknown variable/constant "mui.ComponentsPage.DescriptionText" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:8)

Comment out or remove the code under ;Descriptions (lines 372 to 376). Those are section descriptions for the MUI Components page but you don't have one of those. InstallOptions uses INI files and is slow. Also if you're already using nsDialogs for your own custom pages, might as well save some space and get MUI to use nsDialogs as well. Also I recommend adding SetCompressor /solid lzma for best compression.

Stu


Originally posted by Afrow UK
Also I recommend adding SetCompressor /solid lzma for best compression.
His installer has only very few file to extract, there is no reason to use solid compression. Regular LZMA would be the obvious choice.