^_^

2010年7月1日星期四

NSIS 中根据行命令参数来决定是否显示完成页面中的“运行...”checkbox

!include "FileFunc.nsh"
!include "MUI.nsh"
 
Outfile test.exe
 
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_SHOW pagefinishshow
!define MUI_FINISHPAGE_RUN "notepad.exe"
!insertmacro MUI_PAGE_FINISH
  
Section "secDummy"
  ; ...
SectionEnd
  
!insertmacro MUI_LANGUAGE "English"
 
Function pagefinishshow
  ${GetParameters} $R0
  ${If} $R0 == "/norun"
    GetDlgItem $MUI_TEMP1 $MUI_HWND 1203 ;可用 spy++ detect 该窗口 ID
    SendMessage $MUI_TEMP1 ${BM_SETCHECK} 0 0
    ShowWindow $MUI_TEMP1 ${SW_HIDE}
  ${EndIf}
FunctionEnd
运行效果:
D:\>test

D:\>test /norun
本站文章除注明外,均为本站原创
转载请注明文章转载自: 大笨熊乐园 [ https://blog.foolbear.com/ ]
文章标题: NSIS 中根据行命令参数来决定是否显示完成页面中的“运行...”checkbox
文章地址: https://blog.foolbear.com/2010/07/nsis.html

没有评论 :

发表评论

Related Posts with Thumbnails