Skip to content
⌘ NSIS Forum Archive

Launch as logged in user?

4 posts

gordon stephens#

Launch as logged in user?

I'm struggling to get the MUI_FINISHPAGE_RUN feature to work as I need it to, and searching and reading hasn't helped to resolve it.

When installing my product, elevated priviledges are needed, and so my script contains the
RequestExecutionLevel admin
directive.

To launch the product I also have
!define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_NAME}.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Launch ${PRODUCT_NAME}"
specified.

When the product first runs, it writes to the %APPDATA% directory.
So with elevated priviledges, this variable is resolving to the administrator account.
What I really need is for the software to be running as the current logged in user, not admin.
Is there a straightforwards way to achieve this?

Many thanks!
Anders#
http://nsis.sourceforge.net/ShellExecAsUser_plug-in is a better choice IMHO, it's easy to use and start the process as the "logged in user". The UAC plugin starts processes as the same user that starts the installer which is not the same thing...
gordon stephens#
Thanks so much for the quick replies: the ShellExecAsUser plug in sounds exactly what I need. I'll give it a go...thx!