Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written a windows service in .net to call executables.

There is no problem when executing a .net executable like silverlight installer.

But when i try the same thing for another executable like winrar installer an exception is thrown at CreateProcessAsUser() method.

Method call is this
C#
CreateProcessAsUser(m_SessionTokenHandle, m_ApplicationPath, CommandLine, ref l_oSecurityAttributes,ref l_oSecurityAttributes, 0, creationFlags, envBlock, WorkingDirectory,
                    si, pi)

CreationFlags parameter is set as CREATE_UNICODE_ENVIRONMENT|DETACHED_PROCESS.

Is there any idea about this exception?
Posted
Updated 25-May-12 1:01am
v2

1 solution

Questions:
- What is the exception you got? Error codes might give you ideas.
- What is the OS, you are dealing with? Be aware, that installers that rely on windows installer service, don't need elevated rights with UAC enabled, but standalone installers do.
See this discussion: http://stackoverflow.com/questions/2426594/starting-a-uac-elevated-process-from-a-non-interactive-service-win32-net-power[^]
 
Share this answer
 
Comments
Member 9005298 25-May-12 11:01am    
Thank you in advanced that is the correct idea i was searching whole day.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900