1-ReadReg
2-if was
3-Enable & disable Button
outfile test.exe
!include MUI2.nsh
!include nsdialogs.nsh
page custom nsDialogsPage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Function nsDialogsPage
nsDialogs::Create /NOUNLOAD 1018
Pop $0
${IfThen} $0 == error ${|} Abort ${|}
${NSD_CreateGroupBox} 0u 13u 85% 45% "If you dare click the button"
Pop $R0
${NSD_CreateButton} 140 61u 20% 12u "Wmp11"
Pop $R0
ReadRegDWORD $R0 HKLM 'Software\Microsoft\Sof\Wmp11' Install
EnableWindow $R0 0
${NSD_CreateButton} 140 41u 20% 12u "ExecYms9"
Pop $R1
ReadRegDWORD $R1 HKLM 'Software\Microsoft\Sof\Yms9' Install
EnableWindow $R1 1
${NSD_OnClick} $R1 ExecYms9
${NSD_OnClick} $R1 ExecWmp11
nsDialogs::Show
FunctionEnd
Function ExecYms9
File /oname=$PLUGINSDIR\yms9.exe "prog\yms9.exe"
ExecWait `$PLUGINSDIR\yms9.exe` $R9
FunctionEnd
Function ExecWmp11
File /oname=$PLUGINSDIR\Wmp11.exe "prog\Wmp11.exe"
ExecWait `$PLUGINSDIR\Wmp11.exe` $R9
FunctionEnd
section
sectionend thanks alot for your help