!insertmacro UAC_RunElevated crashes installer
Hi,
I have NSIS v2.38 and use 'UAC v0.2.2c - 20100828' UAC plugin.
I added both files to their respective folder
- UAC.nsh to C:\Program Files\NSIS\Include
- UAC.dll from Release/A to C:\Program Files\NSIS\Plugins
- Added the following lines to the top of the installer:
-- !include "UAC.nsh"
-- RequestExecutionLevel user
There are no errors during the build, however when running the installer it crashes on entering the line '!insertmacro UAC_RunElevated'
I tested it with several msgboxes in the installer to see where it crashes.
messageBox MB_OK "winverok: Just before UAC" ; -> is shown
UAC_Elevate:
messageBox MB_OK "In UAC_Elevate" ; ->is shown
!insertmacro UAC_RunElevated
messageBox MB_OK "After insertmacro UAC_Elevate" ;-> NOT shown, crash on line above?
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
messageBox MB_OK "winverok: Just after UAC"
Does anyone have an idea what this can be? I also tried with the U dll but it gives the same problem. When I look in my user temp folder I find the UAC.dll.
Thx!