Archive: UAC::ExecCodeSegment and parameter


UAC::ExecCodeSegment and parameter
Hi,

I tried to call UAC::ExecCodeSegment with one parameter, but I get the following message box :

---------------------------
UAC_AdminOnly Setup
---------------------------
Installer corrupted: invalid opcode
---------------------------
OK
---------------------------


I modifit the sample UAC_AdminOnly.nsi in UAC plugin directory, like that :

Add function:
-------------
Function ShowMsg
Exch $R8
MessageBox mb_iconstop "ShowMsg R8=[$R8]"
Pop $R8
FunctionEnd


Modify section:
---------------
Section
Push $R0
UAC::IsAdmin
DetailPrint "IsAdmin=$0"

Push "hello"
GetFunctionAddress $R0 "ShowMsg"
UAC::ExecCodeSegment $R0
Pop $R0
SectionEnd

(working on XP, but not on Vista)

What's wrong ?

Thankx


you can not use a normal push, you must use uac::StackPush


I've described the solution for original thread's problem in following post: Passing parameters and retrieving results from inner/outer UAC processes in NSIS-based installer