How to use the UAC Plugin ?
Hi everyone, first of all I'll ask you to excuse my English (yes, I'm French ;) ).
I've got some troubles to make the UAC Plugin working...
I've read the following page : http://nsis.sourceforge.net/UAC_plug-in
And after having downloaded the zip file and read the examples given in it, I compiled them but none succeeded...
Then I just tried to insert the code given in the page in my .nsi :
First :
RequestExecutionLevel user
>
at the beginning of the script,Then
'UAC.nsh'
And to finish
.
Function .OnInit
UAC_Elevate:
UAC::RunElevated
StrCmp 1223$0 UAC_ElevationAborted ; UAC dialog aborted by user?
StrCmp 0 $0 0 UAC_Err ; Error?
StrCmp 1 $1 0 UAC_Success ;Are we the real deal or just the wrapper?
Quit
UAC_Err:
MessageBox mb_iconstop "Unable to elevate, error $0"
Abort
UAC_ElevationAborted:
# elevation was aborted, run as normal?
MessageBox mb_iconstop "This installer requires admin access, aborting!"
Abort
UAC_Success:
StrCmp 1 $3 +4 ;Admin?
StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
MessageBox mb_iconstop "This installer requires admin access, try again"
goto UAC_Elevate
FunctionEnd
>
with my own functions.But when I try to compile, I've got the following error :
Function: ".OnInit"
Invalid command: UAC::RunElevated
Error in script "C:\Users\Me\MyFolder\MyScript.nsi" on line 156 -- aborting creation process
I think I've missed something, the file UAC.nsh is in the same directory as the script (MyFolder).
Can anybody try to help me please ? :cry: