Old 12th February 2007, 20:48   #1
ahdavidson
Junior Member
 
Join Date: Feb 2007
Location: Seattle, WA
Posts: 3
replace CANCEL button text on just one page?

A how-to query from a brand-new NSIS user:

I would like to replace the text of a CANCEL button in the Modern UI for just one page.

I see how to accomplish this globally for all CANCEL buttons in the UI. I also see how to change the text of the ACCEPT/OK/AGREE button on a specific page.

What I have not been able to figure out is if there is an easy way to change the text of the CANCEL button on just the LICENSE page. (Our legal folks are very picky, and would like the UI to present the options as "Agree" or "Do Not Agree" instead of "Agree" or "Cancel.")

Can anyone suggest a solution?

Many thanks,
.andy
ahdavidson is offline   Reply With Quote
Old 12th February 2007, 21:03   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
code:
OutFile "Test.exe"
InstallDir "$PROGRAMFILES\boo"

!include "mui.nsh"

!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_PRE dir_pre
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Section "boo"

SectionEnd

Function dir_pre
GetDlgItem $0 $HWNDPARENT 2
SendMessage $0 ${WM_SETTEXT} "0" "STR:Do Not Agree"
FunctionEnd


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 12th February 2007, 21:18   #3
ahdavidson
Junior Member
 
Join Date: Feb 2007
Location: Seattle, WA
Posts: 3
Thanks for the answer! But being a newbie, I could use a little context for the code.

Where do I put this? fsp.nsi?
And what in that code restricts the replacement to just the Cancel button on the License page?

Thanks.
ahdavidson is offline   Reply With Quote
Old 12th February 2007, 21:47   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Compile the example, execute it and you'll know where and what, all you need is this,
!define MUI_PAGE_CUSTOMFUNCTION_PRE dir_pre
just before your license page, and the function named dir_pre somewhere in your script.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 12th February 2007, 23:26   #5
mirolechat
Junior Member
 
Join Date: Feb 2007
Posts: 1
I'm working with andy on this project. Were both unfamiliar with the build process as we've been using the installer version built into Zinc. Within the zinc/nsis directory we've been editing the system.nsh with limited results to get btn changed.
mirolechat is offline   Reply With Quote
Old 13th February 2007, 04:36   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Don't know what is Zinc. If you're referring to NSIS\Contrib\Modern UI\System.nsh, you shouldn't touch it unless you know exactly what you're doing, you may destroy the Modern ui by doing this.

Anyway, what's the problem and you can't implement just 5 lines of (provided above) code in your script to achieve the text on cancel button specifically for license page?

If you don't know how to copy/paste text within a text editor, this isn't the right place to ask how to do it.
If you know, just copy/paste the line,
code:
!define MUI_PAGE_CUSTOMFUNCTION_PRE dir_pre

just before the license page macro, and add the function,
code:
Function dir_pre
GetDlgItem $0 $HWNDPARENT 2
SendMessage $0 ${WM_SETTEXT} "0" "STR:Do Not Agree"
FunctionEnd


on the bottom of your script.
That's all.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 13th February 2007, 06:06   #7
ahdavidson
Junior Member
 
Join Date: Feb 2007
Location: Seattle, WA
Posts: 3
Thanks very much for the code, and also your kind, patient, and polite attitude towards novices.
ahdavidson is offline   Reply With Quote
Old 13th February 2007, 06:31   #8
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
You're welcome!
I'm just trying within my limited nsis knowledge to help everyone including those with sarcastic attitude.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 26th February 2007, 15:32   #9
M1qu3l
Junior Member
 
Join Date: Feb 2007
Posts: 1
got a new question related!

Hi everybody!

What I was wondering is how it would be if instead of trying to change cancel button text from licence page we try to change cancel button text on language dialog selection.

I cannot figure out because in this case we have not any page defined...

I found couple of tags like MUI_LANGDLL_WINDOWTITLE and MUI_LANGDLL_INFO, but still do not knok to to change buttons text on this dialog....

I'd be really gratefull if someone answer me, but thanks anyway to everybody!
M1qu3l is offline   Reply With Quote
Old 22nd May 2007, 19:25   #10
jackkoho
Member
 
Join Date: Oct 2006
Posts: 70
Quote:
Originally posted by Red Wine
Don't know what is Zinc. If you're referring to NSIS\Contrib\Modern UI\System.nsh, you shouldn't touch it unless you know exactly what you're doing, you may destroy the Modern ui by doing this.

Anyway, what's the problem and you can't implement just 5 lines of (provided above) code in your script to achieve the text on cancel button specifically for license page?

If you don't know how to copy/paste text within a text editor, this isn't the right place to ask how to do it.
If you know, just copy/paste the line,
code:
!define MUI_PAGE_CUSTOMFUNCTION_PRE dir_pre

just before the license page macro, and add the function,
code:
Function dir_pre
GetDlgItem $0 $HWNDPARENT 2
SendMessage $0 ${WM_SETTEXT} "0" "STRo Not Agree"
FunctionEnd


on the bottom of your script.
That's all.
Should this work for an INSTFILES page? Ive tried the exact code and can't get it to work. Trying to change "Close" to "Next>"
jackkoho is offline   Reply With Quote
Old 24th May 2007, 17:37   #11
jackkoho
Member
 
Join Date: Oct 2006
Posts: 70
bump
jackkoho is offline   Reply With Quote
Old 25th May 2007, 16:00   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It should work. If not, put it in a dummy (hidden) Section.

Stu
Afrow UK is offline   Reply With Quote
Old 25th May 2007, 18:45   #13
jackkoho
Member
 
Join Date: Oct 2006
Posts: 70
I realized that it did change cancel to next while it was installing, but then changed back to cancel when it was done.

Another thing: I want to change the "close" button, not the cancel button, so is there a paramater I need to change to make this work?
jackkoho is offline   Reply With Quote
Old 26th May 2007, 13:15   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Just put an empty Page after it.

code:
!insertmacro MUI_PAGE_INSTFILES
Page Custom PageDummy

Function PageDummy
FunctionEnd



No need to change the button text then.

Stu
Afrow UK is offline   Reply With Quote
Old 30th May 2007, 17:34   #15
jackkoho
Member
 
Join Date: Oct 2006
Posts: 70
Thanks.
jackkoho is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump