Search code examples
filerichtextboxnsis

nsRichEdit::Load cannot load license text


I have a custom license page and use a richtextbox to display the license. I use nsRichEdit plugin:

nsDialogs::CreateControl RichEdit20A ${ES_READONLY}|${WS_VISIBLE}|${WS_CHILD}|${WS_TABSTOP}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN} ${WS_EX_STATICEDGE} 17.77u 7.38u 261.32u 80u ""
Pop $RichTextLicense
nsRichEdit::Load $RichTextLicense "${SOURCEFOLDER}\GPL.txt"

But, the richtextbox still empty. Could anyone help me to figure out what's wrong with my code?


Solution

  • ${SOURCEFOLDER} is a compile time define. You must extract the license somewhere on the end-users machine:

    nsDialogs::CreateControl RichEdit20A ${ES_READONLY}|${WS_VISIBLE}|${WS_CHILD}|${WS_TABSTOP}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN} ${WS_EX_STATICEDGE} 17.77u 7.38u 261.32u 80u ""
    Pop $RichTextLicense
    File "/oname=$pluginsdir\gpl.txt" "${SOURCEFOLDER}\GPL.txt" 
    nsRichEdit::Load $RichTextLicense "$pluginsdir\gpl.txt"