Function OnCNChange ${NSD_GetText} $1 $masterCN ${If} $masterCN == "" Call DisableNextButton ${Else} Call EnableNextButton ${EndIf} FunctionEnd Function FuncCertificate ${If} $installUPGRADE == ${BST_CHECKED} Abort ${EndIf} ${If} $installMaster != ${BST_CHECKED} ${AndIf} $installDISTRIBUTED == ${BST_CHECKED} Abort ${EndIf} !insertmacro MUI_HEADER_TEXT "Configuration settings: Certificate" "Please enter configuration settings." nsDialogs::Create /NOUNLOAD 1018 ${NSD_CreateLabel} 0 5u 100% 10u "Certificate Common Name (hostname or IP address):" ${NSD_CreateLabel} 0u 22u 18u 10u "CN:" ${NSD_CreateText} 20u 20u 280u 12u "" Pop $1 ${NSD_OnChange} $1 OnCNChange ${NSD_SetFocus} $1 Call DisableNextButton nsDialogs::Show FunctionEnd Function FuncCertificateLeave ${NSD_GetText} $1 $masterCN ${StrFilter} $masterCN "12" "-." "" $0 StrCmp $0 $masterCN +3 0 MessageBox MB_OK|MB_ICONSTOP "Certificate CN can only contain alphanumeric characters, hyphens and dots." Abort StrCmp $masterCN "localhost" 0 +3 MessageBox MB_OK|MB_ICONSTOP "Certificate CN cannot be $\"localhost$\"." Abort ${If} $masterCN =~ "[A-Z]+" MessageBox MB_OK|MB_ICONSTOP "Certificate CN cannot contain uppercase letters." Abort ${EndIf} FunctionEnd .