Search code examples
pluginsnsis

NSIS Calling Plugin functions from uninstaller


In my NSIS installer I have the !include StrFunc.nsh as well as others and call the ${StrCase} function fine when needed.

But I now need to call the ${StrCase} function in my uninstaller but every time I try and call it, it does not compile.

Question is how do I get plugins imported into my uninstaller so I can reference their functions?

I have tried ${un.StrCase} and I have also tried !include un.StrFunc.nsh

But still no luck.

Does someone have a working example they can show me so I can understand and how these are mean to work.

TIA Andy


Solution

  • The documentation for StrFunc.nsh says

    3.2 How To Use Commands In Uninstall Sections and Functions


    Commands with Uninstall Sections and Functions support have "Un" before the words inside curly brackets "{}".

    Example:


    ${UnStrStr}

    A complete example with both Install and Uninstall Commands: ------------------------------------------------------------

    !include "StrFunc.nsh"
    
    ${StrStr} # Supportable for Install Sections and Functions
    
    ${UnStrStr} # Supportable for Uninstall Sections and Functions
    
    Section
    
    ${StrStr} $0 "OK! Now what?" "wh"
    
    SectionEnd
    
    Section Uninstall
    
    ${UnStrStr} $0 "OK! Now what?" "wh"
    
    SectionEnd