views:

28

answers:

2

I have a win32 process running as admin mode. I cannot change the fact it's running in admin mode. I have an executable on my system which I'd like to launch from that admin process, but have it run in user mode.

How do I achieve that?

A: 

you can use CreateProcessAsUser Win32 API see MSDN for help.

ajay_whiz
I don't know the password of the user name that ran the application. This is an installer application running in admin. At the end, I have to launch the installed app as User. CreateProcessAsUser requires me to create a token with the user ID and password. I can't have that information.
Ron M.
is the installer app a MSI? and when you say `This is an installer application running in admin` do you mean the administrator is logged in and he is installing the application or the installer is running with elevated privileges?
ajay_whiz
It's NSIS... I can't change that fact unfortunately.
Ron M.
and yes. the person running the installation is admin
Ron M.
@Ron in that case it is not possible to achieve what you want.
ajay_whiz
+1  A: 

To do this with NSIS, you have to use the UAC plugin (But I would recommend you just remove the run checkbox on the finish page if this is the issue you want to fix)

Anders
I can't turn off the "run". running the application is a MUST from this installer. no way around it. I'm getting desperate. I tried using UAC plugin but it didn't work. their own examples don't even pass compilation. failing on the UAC function calls even though i did every single step on their instructions. I really don't know what to do.
Ron M.
You need to use the examples in the .zip, the wiki code is not up to date
Anders
will definitely give that a try.... again.
Ron M.

related questions