R
Ray Mitchell
Hello,
I wrote a C# GUI application that I use to install, uninstall, start, and
stop arbitrary Windows services. Although I would like to have handled all
the gorey details in the C# code itself, I only found one example of how to
do this on the Internet and I could never get it to work properly. As an
alternative I decided to merely use the C# code as a GUI wrapper around
running the Microsoft "installutil.exe" executable as a process. As klugey
as it may seem it worked perfectly in all respects, but that was under
Windows XP. When I now try use this setup on Windows 7 I get the following
error message every time my C# application tries to run the installutil.exe
process: <The requested operation requires elevation: Installer file
"installutil.exe".> This apparently means that I somehow have to grant
administrator privileges to the running of installutil.exe, even though I'm
already logged on as administrator. So, I guess it really all boils down to
how to set the appropriate privileges for a process that is started from
within a C# application so it will work properly on Windows 7 (and I assume
Windows Vista too). Is there something I can change in my code so that it
sets the privileges appropriately to run this process?
As an aside, if anyone knows of some C# code that actually works directly to
install, uninstall, start, and stop arbitrary Windows services without the
need for installutil.exe at all, I would appreciate information on it.
However, I assume I will still need to deal with the administrator privilege
issue.
Thanks,
Ray
I wrote a C# GUI application that I use to install, uninstall, start, and
stop arbitrary Windows services. Although I would like to have handled all
the gorey details in the C# code itself, I only found one example of how to
do this on the Internet and I could never get it to work properly. As an
alternative I decided to merely use the C# code as a GUI wrapper around
running the Microsoft "installutil.exe" executable as a process. As klugey
as it may seem it worked perfectly in all respects, but that was under
Windows XP. When I now try use this setup on Windows 7 I get the following
error message every time my C# application tries to run the installutil.exe
process: <The requested operation requires elevation: Installer file
"installutil.exe".> This apparently means that I somehow have to grant
administrator privileges to the running of installutil.exe, even though I'm
already logged on as administrator. So, I guess it really all boils down to
how to set the appropriate privileges for a process that is started from
within a C# application so it will work properly on Windows 7 (and I assume
Windows Vista too). Is there something I can change in my code so that it
sets the privileges appropriately to run this process?
As an aside, if anyone knows of some C# code that actually works directly to
install, uninstall, start, and stop arbitrary Windows services without the
need for installutil.exe at all, I would appreciate information on it.
However, I assume I will still need to deal with the administrator privilege
issue.
Thanks,
Ray