473,669 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Installing service programatically on Vista not working if UAC enabled?

Hi all.

I have a Winforms app that installs a service programatically (as opposed to
using InstallUtil).

If UAC on Vista is disabled, it works fine. Likewise, if the program is
started by right-clicking and picking "Run as Administrator" it works (if
UAC is enabled), but neither option is ideal. I suppose really I want UAC to
pop up it's "do you want to allow this to happen" box when my code does its
thing. Can anyone point me in the direction of how to achieve this?

Thanks!
Feb 15 '08 #1
2 1998
You can add a manifest that makes your app run with Administrator permissions
using the "mt" utility. Willy DeNoyette describes here:
http://groups.google.com/group/micro...71bf72d0ad75a6

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"JamesB" wrote:
Hi all.

I have a Winforms app that installs a service programatically (as opposed to
using InstallUtil).

If UAC on Vista is disabled, it works fine. Likewise, if the program is
started by right-clicking and picking "Run as Administrator" it works (if
UAC is enabled), but neither option is ideal. I suppose really I want UAC to
pop up it's "do you want to allow this to happen" box when my code does its
thing. Can anyone point me in the direction of how to achieve this?

Thanks!
Feb 15 '08 #2

"Peter Bromberg [C# MVP]" <pb*******@yaho o.NoSpamMaam.co mwrote in message
news:AB******** *************** ***********@mic rosoft.com...
You can add a manifest that makes your app run with Administrator
permissions
using the "mt" utility. Willy DeNoyette describes here:
http://groups.google.com/group/micro...71bf72d0ad75a6
Thanks for the reply - i'll give it a try!

Feb 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
20210
by: Don | last post by:
QUESTIONS: 1. Has anyone figured out how to successfully install the Office 97 Pro Service Release 2 patch in Vista? 2. Has anyone successfully installed an Office 97 Pro CD (SR2 version) in Vista? DETAILS: My setup: Dell Inspiron notebook with Vista Business edition My CD: Office 97 Professional (Service Release 1) Upgrade
3
3994
by: gourmet | last post by:
Hello! I need to restart the "Windows Audio Service" (audiosrv) via C#. I'm using the ServiceController Class to do this. It is no problem under XP and no problem under vista if UAC is disabled. But with enabled UAC i'm getting a "access refused" exception. I also tried to do it via console with "net start ..." but the same error appears. Three questions:
33
11842
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon (NT_AUTHORITY\SYSTEM). I understand that when the service starts, no user may be logged in, but that's ok, as the app I am monitoring can only be run by a logged in user. Do I need to use WMI to get the user context of Explorer.exe or is there a...
5
4715
by: eliasen | last post by:
Hi I have created a Windows Service using C# and .NET2.0. The service is quite simple - right now it doesn't do anything except throwing an exception in the OnStart method. It used to something more, but I couldn't get it working, so I boiled it down to the exception to test. Anyway, the service can be installed using InstalUtil but when starting the service, I just get the message that the service stopped again withour reporting any...
17
12057
by: merrily | last post by:
Read in one forum the question someone asked after successfully (sort of) installing Picture It 2000 on new computer with Vista. Will this person or any other help me accomplish this install on Vista, please. I tried installing Picture It and it seemed to do so. I got no error messages but it sure took a long time. Then when I tried to open the program it said "access denied" adding that I needed 30 meg of disk space (implying I didn't)...
1
4506
by: svandanapu | last post by:
Hi All, I written one windows service and its working fine. I Need to check the recovery settings of that service from one windows application. How do I can get the recovery settings of(first failure, second failure and third failure) a service programatically. can any one please help me in this regard. Thanks in advance Sivakumar V
1
1997
by: rufusking | last post by:
My requirement is to change the IP Address of local system programatically using .net. IP Address should change to 10.1.2.100, subnet mask = 255.255.255.0, default gateway=10.1.2.1 I have created a small C# Console application in Visual Studio 2005 which change the IP address of the local system. I execute the following batch file using Process.Start("ipchange1.bat"); Content of batch file is: set path=c:\Windows\System32 netsh...
2
2012
by: Tam | last post by:
Im running into problems installing either VS 05 or 08 on a Vista Premium 64 bit machine and, ahem, it isnt going sweetly. When installing i get an "Error 1935.An error occured during the installation of assembly component" when installing either 05 or 08. Vista Premium comes with .NET Framework 2.0 and Framework 3.5 which are both present. It also has Framerwork 1.0 SP3 Developer. As an
2
2378
by: =?Utf-8?B?TUNN?= | last post by:
My development machine is running Vista x64. I cannot find the ASP.NET StateServer Service in my list of available Services. Do you know how I can enable this?
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8588
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.