Old 20th September 2010, 13:48   #1
Stieven76
Junior Member
 
Join Date: Jun 2010
Posts: 6
!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.
code:

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!
Stieven76 is offline   Reply With Quote
Old 20th September 2010, 14:03   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Try updating NSIS.

Stu
Afrow UK is offline   Reply With Quote
Old 20th September 2010, 14:39   #3
Stieven76
Junior Member
 
Join Date: Jun 2010
Posts: 6
Lol so simple. That fixed it... I looked everywhere, but just not there
Thx!
Stieven76 is offline   Reply With Quote
Old 20th September 2010, 14:42   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Newer versions of the UAC plugin needs NSIS 2.42 IIRC (The new plugin API)

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