Archive: NSIS Plugin development problem (Delphi)


NSIS Plugin development problem (Delphi)
Hi,

I'm currently developing a NSIS plugin that retrieves the current security context for the logged user.

The function GetAccountType should return the security context values as defined in the MSDK (202 for Admin, 203 for User...). I'm sure my problem is fairly simple, but how can I return this value back to NSIS if the function is called ?

Do I need to use variable and push the value onto the stack. Can you post me some kind of Delphi code ?

My code looks like this:

function GetAccountType: integer;
begin
... retrieve security context ...

// Return result

Result := AccountType; <== Should be returned to NSIS ... HOW ??
end;

Any help is appreciated

Romain


Use PushString from exdll.dpr like in the example in exdll.dpr. PushString will push any string to the NSIS stack. You can also put it in a NSIS variable ($0-$9,$R0-$R9,etc.) using GetUserVariable. Just remember, NSIS variables are strings and so is the stack.


Will give it a try.

Thanks !