2013-08-21 202 views
0

我是很新的NSIS, 我創建了一個簡單的安裝有2個屏幕,更改默認的按鈕名稱NSIS

!include LogicLib.nsh 
!include nsDialogs.nsh 

Page custom someName someEndmethod 
Page instfiles 

第一個是一個自定義頁面(nsDialogs)和它的默認按鈕是「安裝「和我有2任務:

  • 我如何將方法綁定到其單擊事件?
  • 如何更改該按鈕上的文字?

順便說一句 - 我沒有使用MUI。

我能關於nsDialogs發現的最好的參考資料是以下幾點: http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html

但也似乎無法找到答案,這些簡單的問題。

感謝

+0

nsDialogs和其他自定義頁面位於內部對話框區域,底部的按鈕不是,實際上並未由用於創建自定義頁面的插件控制。主要幫助文件中記錄了關於在離開回調中調用Abort的部分... – Anders

回答

1
!include WinMessages.nsh 
Function MyPageCreate 
GetDlgItem $0 $hwndparent 1 ; Get the handle to the button 
SendMessage $0 ${WM_SETTEXT} 0 `STR:$(^NextBtn)` ; The part after STR: can be any string, using the next button language string here 
nsDialogs::Create 1018 
pop $0 
nsDialogs::Show 
FunctionEnd 

Function MyPageLeave 
MessageBox mb_yesno "User clicked Next/Install, allow the page change?" IDYES allow 
    Abort 
allow: 
FunctionEnd 

Page Components 
Page Custom MyPageCreate MyPageLeave 
Page InstFiles 

如果你只是想改變安裝按鈕字符串無論是在(該頁面在頁面instfiles之前),其頁面,您可以用LangString,而不是改變它。