Search code examples
nsis

How detect launch NSIS installer with arguments


I have NSIS installer. How detect launch NSIS installer with arguments?

For example installer.exe /DEBUG


Solution

  • GetOptions:

    !include FileFunc.nsh
    !include LogicLib.nsh
    
    Function .onInit
    ${GetParameters} $0
    ClearErrors
    ${GetOptions} $0 "/DEBUG" $1
    ${IfNot} ${Errors}
        MessageBox mb_ok "Debug"
    ${EndIf}
    FunctionEnd