Old 18th July 2019, 14:00   #1
meoit
Member
 
Join Date: Oct 2014
Location: $DESKTOP
Posts: 90
Post Why installer no restart ?.

I need installer restart and run in runas shell.

This is script:

Quote:
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.
meoit is offline   Reply With Quote
Old 18th July 2019, 18:44   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,163
Works for me.

Please note that:

1) RunAs is broken when UAC is off.

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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump