Skip to content
⌘ NSIS Forum Archive

Why installer no restart ?.

2 posts

meoit#

Why installer no restart ?.

I need installer restart and run in runas shell.

This is script:

Var /Global Button_Restart

${NSD_OnClick} $Button_Restart Button_Restart_click

!define RunAs '!insertmacro RunAs'
!macro RunAs
userinfo::GetAccountType
Pop $0
${If} $0 != 'admin'
StrCpy $0 $EXEPATH
MessageBox MB_OK|MB_USERICON|MB_TOPMOST 'Run-as.'
ExecShell 'runas' '$0'
Quit
${EndIf}
!macroend

Function Button_Restart_click
${RunAs}
FunctionEnd
Why installer no restart ?.
Please help.
Thanks.
Anders#
Works for me.

Please note that:

1) RunAs is broken when UAC is off.

2) RunAs can start apps as non-admin on < Vista