Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  mystery External Dependencies and basetsd.h  Visual C++ ProgrammingNext Question:  360 sales 6% up over original xbox  Xbox 360

Question Unable to install Window Service on Vista ( CodeGuru Forums Visual C++ Programming )
Updated: 2008-08-12 06:06:07 (23)
Unable to install Window Service on Vista

I have been unable to install a Window Service onto a Vista OS. The compiler (VS 2005, CLR C++ Window Service) is the same on my other machine (VS 2005, CLR C++ Window Service) Win XP Pro.

From the Visual Studio Command Prompt, using the command 'MyService.exe -Install' works just fine on XP Pro but fails on VISTA.

The VISTA installation fails with the following message:
Quote:
An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.


Seems like a security problem, but I havn't a clue how to resolve it.
Any help greatly appreciated.

Answers: Unable to install Window Service on Vista ( CodeGuru Forums Visual C++ Programming )
Unable to install Window Service on Vista

The service account that you have set, doesn't have sufficient permissions to install the custom event log.

One way to solve this is to create a setup program to set up the event log source and install your service.

Another way is to just create a simple console app to do it for you (and run the app under Admin permissions).

Code:
class Program { static void Main( string[ ] args ) { bool unInstall = false; foreach( string arg in args ) { switch( arg.ToUpper( ) ) { case Constants.Switches.UninstallHyphen: case Constants.Switches.UninstallSlash: unInstall = true; break; } } if( unInstall && System.Diagnostics.EventLog.SourceExists( Constants.EventLog.Source ) ) { System.Diagnostics.EventLog.DeleteEventSource( Constants.EventLog.Source ); System.Diagnostics.EventLog.Delete( Constants.EventLog.Log ); return; } if( !System.Diagnostics.EventLog.SourceExists( Constants.EventLog.Source ) ) { // NOTE: Requires 'domain\user' logon w/admin privileges for event source creation System.Diagnostics.EventLog.CreateEventSource( Constants.EventLog.Source, Constants.EventLog.Log ); } } }



Unable to install Window Service on Vista

Get exactly the same result. The installation proceeds, an error occurs, then a rollback and termination. Here's the whole console printout:

Quote:
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe assembly's progress.
The file is located at C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.InstallLog.
Installing assembly 'C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SER
VICES\MySvc4\debug\MySvc4.exe
logfile = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES
\MySvc4\debug\MySvc4.InstallLog
Installing service MySvc4...
Creating EventLog source MySvc4 in log Application...

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe assembly's progress.
The file is located at C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.InstallLog.
Rolling back assembly 'C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SER
VICES\MySvc4\debug\MySvc4.exe
logfile = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.InstallLog
Restoring event log to previous state for source MySvc4.
An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.


Inspection of the MySvc4Install.log, as suggested by this console printout, reveals an exact copy of the same printout. Hardly enlightening.

This service was set up to be a LocalSystem Account type. That works just fine in XPPro.

Is there some VISTA security switch that needs to be reset?

Mike Pliam

Unable to install Window Service on Vista

Do you have a ProjectInstaller class for your Service?



Unable to install Window Service on Vista

Here it is:
Code:
#pragma once using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Configuration::Install; namespace MySvc4 { [RunInstaller(true)] /// <summary> /// Summary for ProjectInstaller /// </summary> public ref class ProjectInstaller : public System::Configuration::Install::Installer { public: ProjectInstaller(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~ProjectInstaller() { if (components) { delete components; } } private: System::ServiceProcess::ServiceProcessInstaller^ serviceProcessInstaller1; protected: private: System::ServiceProcess::ServiceInstaller^ serviceInstaller1; private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->serviceProcessInstaller1 = (gcnew System::ServiceProcess::ServiceProcessInstaller()); this->serviceInstaller1 = (gcnew System::ServiceProcess::ServiceInstaller()); // // serviceProcessInstaller1 // this->serviceProcessInstaller1->Account = System::ServiceProcess::ServiceAccount::LocalSystem; this->serviceProcessInstaller1->Password = nullptr; this->serviceProcessInstaller1->Username = nullptr; // // serviceInstaller1 // this->serviceInstaller1->Description = L"Test Vista Service"; this->serviceInstaller1->DisplayName = L"MySvc4"; this->serviceInstaller1->ServiceName = L"MySvc4"; this->serviceInstaller1->StartType = System::ServiceProcess::ServiceStartMode::Automatic; // // ProjectInstaller // this->Installers->AddRange(gcnew cli::array< System::Configuration::Install::Installer^ >(2) {this->serviceProcessInstaller1, this->serviceInstaller1}); } #pragma endregion }; }

Mike Pliam

Unable to install Window Service on Vista

Open a Visual Studio command prompt and type:

Code:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>InstallUtil MySvc.Exe


Er, well fix up the paths as appropriate.



Unable to install Window Service on Vista

Quote:
Your attitude is remindful of people who are afraid to criticize organized religion or a particular political party openly


From my experience criticising Microsoft has the same effect as criticising the above organisations. No effect at all. None. Zero.

Criticism like this is all well and good, but it won't get the job done.

I'm with Arjay on this one. Complain all you like, but you should follow the route which Microsoft has decided is the correct one.

There's always Linux to code in if you don't like Microsoft's OSes. And if you don't mind selling zero units...

Darwen.



Unable to install Window Service on Vista

Also, turning off UAC may be fine for you on your machine, but if you plan to distribute your application, don't count on users being able to do that.

If one of your users is in a corporate environment, they very well may not be able to disable UAC. The best bet is to leave UAC on, but you need to tell your users that the need to be able to obtain administrator rights (i.e. username/password) to install it, or to have a system admin install it for them.

krmed

Unable to install Window Service on Vista

I realize that it's 'politically incorrect' and naive to be critical of Microsoft. But you must admit, this thread is fairly lengthy. It was the blog that helped my quickly solve the problem.

Arjay, sorry to be so slow, but precisely what do you mean by 'Run as Administrator' ? My assumption was that since I was signed in as 'Administrator', that I was running the installation as an 'Administrator'. In fact, the entire installation from the Visual Studio Command Prompt fails, not just your code to create the EventLog file. If there is some special way to create an installation process 'As Administrator', could you please explain this? I know that many others struggling in the VISTA quagmire would appreciate knowing about this.

FWIW, since Microsoft doesnt pay me anything, I feel comfortable in going on record as saying that I think the blog is pretty much right on target. Microsoft has done more to make my own programming efforts productive, and I am totally devoted to Microsoft. For that very reason, I think it is important to point out certain short-comings when they arise. Your attitude is remindful of people who are afraid to criticize organized religion or a particular political party openly. IMHO, such an attitude does more harm than good.

Mike Pliam

Unable to install Window Service on Vista

Your event log source doesn't look valid.

EventLog.CreateEventSource method

Have you looked at the code snippet for this method in msdn?

The Source definitely doesn't include a path to a file.

Try something simple like:

Code:
public const string Log = "MySvc4Log"; public const string Source = "MySvc4Source";



Unable to install Window Service on Vista

Tried that. Result exactly the same.

Check this out. What are your thoughts? Could this be our problem?

http://www.codinghorror.com/blog/archives/000571.html



THIS IS THE PROBLEM! Even though you are logged on with 'Administrator' privileges, you really don't have them as long as UACs are turned on.

To install a Window Service in Vista Ultimate (don't know about other Vista OS s), you need to change the UAC as suggested by the blog cited above.

Control Panel -> click on User Accounts -> Turn User Account Control on or off. Reboot computer to take effect.

After reboot, Window Service installation proceeds just as in Win XP Pro. There is probably no easy way to turn off UACs programatically, so this makes VISTA a pain in the *** to program, at least using VS 2005, as far as I can tell. BTW, turning off UACs changes other account specific application settings, for example, the Compuserve Dialer.

Too bad you don't have an emoticon depicting 'disgust'.

Mike Pliam

Unable to install Window Service on Vista

My thoughts are that I don't bother reading articles like that.

Rather than just complain about some feature that Microsoft has implemented, I prefer to understand why the feature was implemented the way it was and what I need to do to work with the feature.

For this problem, I just ran the event log setup program under 'Run as administrator'. The log registered fine and appeared in the Event Viewer.



Unable to install Window Service on Vista

I can compile and run your code using VC 2005 C#. (Note that I had to change the 'partial' so it immediately preceeds 'class', otherwise there occurs a compiler error.)

I have compiled a Window Service using the C++ CLR Window Service model on the VISTA OS. That same service, when compiled on Win XP Pro, installs and works just fine.

Here is my version of your code:

Code:
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; public static partial class Constants { public const int InvalidIndex = -1; public const string NewLine = "\r\n"; public const int StopEvent = 0; public static class Switches { public const string UninstallSlash = "/U"; public const string UninstallHyphen = "-U"; } public static class EventLog { public const string Log = "MySvc4Log"; public const string Source = "C:\\Users\\mbpliam\\Documents\\Visual Studio 2005\\Projects\\C++\\SERVICES\\MySvc4\\debug\\MySvc4.exe"; } } class Program { static void Main(string[] args) { bool unInstall = false; //bool unInstall = true; foreach (string arg in args) { switch (arg.ToUpper()) { case Constants.Switches.UninstallHyphen: case Constants.Switches.UninstallSlash: unInstall = true; break; } } if (unInstall && System.Diagnostics.EventLog.SourceExists(Constants.EventLog.Source)) { System.Diagnostics.EventLog.DeleteEventSource(Constants.EventLog.Source); System.Diagnostics.EventLog.Delete(Constants.EventLog.Log); return; } if (!System.Diagnostics.EventLog.SourceExists(Constants.EventLog.Source)) { // NOTE: Requires 'domain\user' logon w/admin privileges for event source creation System.Diagnostics.EventLog.CreateEventSource(Constants.EventLog.Source, Constants.EventLog.Log); } } }



Here is the result of running your program:

Quote:
Unhandled Exception: System.Security.SecurityException: The source was not found
, but some or all event logs could not be searched. Inaccessible logs: Security
.
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String m
achineName, Boolean readOnly)
at System.Diagnostics.EventLog.SourceExists(String source, String machineName
)
at System.Diagnostics.EventLog.SourceExists(String source)
at Program.Main(String[] args) in C:\Users\mbpliam\Documents\Visual Studio 20
05\Projects\C#\CSharp_ConsoleTestBed\ConsoleTestBed\ServiceSetup.cs:line 53
The Zone of the assembly that failed was:
MyComputer


As noted, I am signed in with Administrator privileges. Somehow, there is a security issue that remains.

Mike Pliam

Unable to install Window Service on Vista

Here it is:
Code:
#pragma once using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Configuration::Install; namespace MySvc4 { [RunInstaller(true)] /// <summary> /// Summary for ProjectInstaller /// </summary> public ref class ProjectInstaller : public System::Configuration::Install::Installer { public: ProjectInstaller(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~ProjectInstaller() { if (components) { delete components; } } private: System::ServiceProcess::ServiceProcessInstaller^ serviceProcessInstaller1; protected: private: System::ServiceProcess::ServiceInstaller^ serviceInstaller1; private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->serviceProcessInstaller1 = (gcnew System::ServiceProcess::ServiceProcessInstaller()); this->serviceInstaller1 = (gcnew System::ServiceProcess::ServiceInstaller()); // // serviceProcessInstaller1 // this->serviceProcessInstaller1->Account = System::ServiceProcess::ServiceAccount::LocalSystem; this->serviceProcessInstaller1->Password = nullptr; this->serviceProcessInstaller1->Username = nullptr; // // serviceInstaller1 // this->serviceInstaller1->Description = L"Test Vista Service"; this->serviceInstaller1->DisplayName = L"MySvc4"; this->serviceInstaller1->ServiceName = L"MySvc4"; this->serviceInstaller1->StartType = System::ServiceProcess::ServiceStartMode::Automatic; // // ProjectInstaller // this->Installers->AddRange(gcnew cli::array< System::Configuration::Install::Installer^ >(2) {this->serviceProcessInstaller1, this->serviceInstaller1}); } #pragma endregion }; }

Mike Pliam

Unable to install Window Service on Vista

Open a Visual Studio command prompt and type:

Code:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>InstallUtil MySvc.Exe


Er, well fix up the paths as appropriate.



Unable to install Window Service on Vista

Get exactly the same result. The installation proceeds, an error occurs, then a rollback and termination. Here's the whole console printout:

Quote:
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe assembly's progress.
The file is located at C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.InstallLog.
Installing assembly 'C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SER
VICES\MySvc4\debug\MySvc4.exe
logfile = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES
\MySvc4\debug\MySvc4.InstallLog
Installing service MySvc4...
Creating EventLog source MySvc4 in log Application...

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe assembly's progress.
The file is located at C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.InstallLog.
Rolling back assembly 'C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.exe'.
Affected parameters are:
logtoconsole =
assemblypath = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SER
VICES\MySvc4\debug\MySvc4.exe
logfile = C:\Users\mbpliam\Documents\Visual Studio 2005\Projects\C++\SERVICES\MySvc4\debug\MySvc4.InstallLog
Restoring event log to previous state for source MySvc4.
An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.


Inspection of the MySvc4Install.log, as suggested by this console printout, reveals an exact copy of the same printout. Hardly enlightening.

This service was set up to be a LocalSystem Account type. That works just fine in XPPro.

Is there some VISTA security switch that needs to be reset?

Mike Pliam

Unable to install Window Service on Vista

I have been unable to install a Window Service onto a Vista OS. The compiler (VS 2005, CLR C++ Window Service) is the same on my other machine (VS 2005, CLR C++ Window Service) Win XP Pro.

From the Visual Studio Command Prompt, using the command 'MyService.exe -Install' works just fine on XP Pro but fails on VISTA.

The VISTA installation fails with the following message:
Quote:
An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.


Seems like a security problem, but I havn't a clue how to resolve it.
Any help greatly appreciated.

Mike Pliam

Unable to install Window Service on Vista

Despite the fact that I am logged on as 'Administrator' ?

What sort of code is it that you have posted ? Looks like C# to me. But VC 2005 doesnt recognize the 'Constants' (The name 'Constants' does not exist in the current context).

How can I compile your program? How to run it ?

(Sorry to be so slow.)

Mike Pliam

Unable to install Window Service on Vista

When you run InstallUtil, it executes the service ProjectInstaller code under the account the service is logged on under. In your case that's 'Service Account' (based on your code snippet above). Somewhere during the install process the service is attempting to write to your custom event log source or the code is attempting to create the eventlog source and it's failing (because the Service account doesn't have the permissions).

As far as my code. Constants is just a static class with a series of embedded static classes that contain constant fields.

It allows me to write beautiful code such as...
Code:
EventLog.CreateEventSource( Constants.EventLog.Source, ... );

and
Code:
case Constants.Switches.UninstallHyphen:


Code:
public partial static class Constants { public const int InvalidIndex = -1; public const string NewLine = "\r\n"; public const int StopEvent = 0; public static class Switches { public const string UninstallSlash = "/U"; public const string UninstallHyphen = "-U"; } public static class EventLog { public const string Log = "Put your service log name here"; public const string Source = "Put your service source name here"; } }



Unable to install Window Service on Vista

The service account that you have set, doesn't have sufficient permissions to install the custom event log.

One way to solve this is to create a setup program to set up the event log source and install your service.

Another way is to just create a simple console app to do it for you (and run the app under Admin permissions).

Code:
class Program { static void Main( string[ ] args ) { bool unInstall = false; foreach( string arg in args ) { switch( arg.ToUpper( ) ) { case Constants.Switches.UninstallHyphen: case Constants.Switches.UninstallSlash: unInstall = true; break; } } if( unInstall && System.Diagnostics.EventLog.SourceExists( Constants.EventLog.Source ) ) { System.Diagnostics.EventLog.DeleteEventSource( Constants.EventLog.Source ); System.Diagnostics.EventLog.Delete( Constants.EventLog.Log ); return; } if( !System.Diagnostics.EventLog.SourceExists( Constants.EventLog.Source ) ) { // NOTE: Requires 'domain\user' logon w/admin privileges for event source creation System.Diagnostics.EventLog.CreateEventSource( Constants.EventLog.Source, Constants.EventLog.Log ); } } }



Unable to install Window Service on Vista

Do you have a ProjectInstaller class for your Service?



Unable to install Window Service on Vista

Quote:
Originally Posted by Mike Pliam
I realize that it's 'politically incorrect' and naive to be critical of Microsoft. But you must admit, this thread is fairly lengthy. It was the blog that helped my quickly solve the problem.

Arjay, sorry to be so slow, but precisely what do you mean by 'Run as Administrator' ? My assumption was that since I was signed in as 'Administrator', that I was running the installation as an 'Administrator'. In fact, the entire installation from the Visual Studio Command Prompt fails, not just your code to create the EventLog file. If there is some special way to create an installation process 'As Administrator', could you please explain this? I know that many others struggling in the VISTA quagmire would appreciate knowing about this.

FWIW, since Microsoft doesnt pay me anything, I feel comfortable in going on record as saying that I think the blog is pretty much right on target. Microsoft has done more to make my own programming efforts productive, and I am totally devoted to Microsoft. For that very reason, I think it is important to point out certain short-comings when they arise. Your attitude is remindful of people who are afraid to criticize organized religion or a particular political party openly. IMHO, such an attitude does more harm than good.

With regard to 'Run as adminstrator'. All you need to do is open explorer and right click on a program and choose 'Run as administrator'. As far as not knowing this, did you look this up in google to find out what it was? A quick search in google for "'Run as administrator' Vista" would have explained it.

As you have said, you have made several incorrect assumptions on what accounts are used for the registration process. In Vista, security has been tightened up (as it was in Win2003, XP, and any preceding OS version). Anytime a new version comes out, it's up to the developer to understand the new differences and learn to code for them.

Quote:
Your attitude is remindful of people who are afraid to criticize organized religion or a particular political party openly.
First of all, I am not paid by Microsoft. In addition, I am a volunteer on this site and not paid by Jupiter Media (who hosts this site).

That said, it tiresome to hear folks complain about things when it's pretty apparent that folks haven't taking the time to learn about what they are having trouble with. [I'm not directing this at you, Mike]

I answer alot of questions here and frequently I find that folks are too quick to blame Microsoft. 99.9% of the time, the issue is with their own code because of assumptions that they've made. I find it amusing when folks complain that they can't find anything in Msdn. Well it's a tool, and you need to learn how to use the tool. Once you do, Msdn has great info for api's and classes. Of course it doesn't mean that you'll find everthing in Msdn.

I don't believe I blindly defend Microsoft at all. Recently I suggested that folks use WPF. One of the guys on here looked into it and complained that there wasn't a Xaml editor built into Visual Studio. Actually there is one, but it's read only - it's not like the editor you would get with WinForms. I didn't defend Microsoft. I understand why Microsoft did what they did, but I would like to see a full featured Xaml editor in the future.

So now that you've solved the problem, would you mind posting the exact steps so that others may benefit?



Unable to install Window Service on Vista

Mike, with Vista, even if you log in as the Administrator, you still run applications in a "standard user" mode. If that application attempts to do something that is only permitted for an administrator, the UAC will appear asking you to confirm that you want to allow it. This apparently was done to prevent an administrator from corrupting the system when he runs a program that he didn't realize was trying to do something malicious. If it automatically assumed admin privilege, the damage would be done without a chance to prevent it.

It's probably a good thing, but it can be annoying. However, logged in as administrator, all you have to do is confirm that you want to allow the action. If you were not logged in as administrator, you would have to supply an administrator username and password.

krmed

Unable to install Window Service on Vista

Gentlemen,

Thank you for your candid responses.

Even if one is logged on with 'Administrative Privileges', the UAC defaults those privileges to Standard. Even after I had grasped that concept, I still failed to understand a key point. Googling as Arjay suggested came up with the following: (see http://www.jimmah.com/vista/Security/uac.aspx)

Quote:
A program either starts with STANDARD rights or, if you give permission, ADMINISTRATOR rights, and once the program is running it cannot change from one to the other. If a program that you have already started with admin powers starts another program, that program will automatically
be given admin powers without needing your permission. For example, if you start the command prompt as administrator, and then start notepad from that command prompt, notepad WILL ALSO automatically run WITH admin powers, and will not ask for permission.


The significance of this with respect to 'Run as Administrator' is that, if one right-clicks on the Visual Studio 2005 desktop icon and then selects 'Run as Administrator', that session of Visual Studio will have Administrative privileges. That means that the Visual Studio Command Prompt (which must be installed in VS to show up on the Tools menu), will ALSO have Administrative prvileges. This will allow one to install and/or uninstall a Window Service just as one would with Win XP Pro.

IMHO, if one has signed in as an Administrator, this rigamorole just adds another layer of complexity. After all, if you can't trust your Administrator, who can you trust?

Thanks again for your patience and honest responses.

Mike Pliam

Previous Question:  mystery External Dependencies and basetsd.h  CodeGuru Forums  Visual C++ ProgrammingNext Question:  360 sales 6% up over original xbox  PS3Forums  Xbox 360

- Source: Unable to install Window Service on Vista CodeGuru Forums Visual C++ Programming
- Previous Question: mystery External Dependencies and basetsd.h CodeGuru Forums Visual C++ Programming
- Next Question: 360 sales 6% up over original xbox PS3Forums Xbox 360





AllQuests.com


Best dedicated servers   Top dedicated servers   Cheap dedicated servers   Linux dedicated servers   Windows dedicated servers   Unmetered dedicated servers