Search code examples
nsis

NSIS ShellExecAsUser plugin not found


I'd like to use the ShellExecAsUser plugin with NSIS 3.08.

I have placed the plugin .dll Unicode version into the "Plugins\x86-unicode" and the ANSI version into the "Plugins\x86-ansi" directory.

When I do

!insertmacro ShellExecAsUser::ShellExecAsUser 'open' '$INSTDIR\bin\program.exe' '' '' ''

... then makensis produces the following error:

!insertmacro: macro named "ShellExecAsUser::ShellExecAsUser" not
found!

What do I need to do to make the plugin work?


Solution

  • Plug-ins don't use !insertmacro.

    Just call it directly:

    ShellExecAsUser::ShellExecAsUser "" cmd.exe "/k echo Hello" SW_SHOWDEFAULT