Hena

New Member
Joined
Oct 27, 2009
Messages
2
Sorry for posting this in the wrong thread but I'm not able to find where exactly this would go.

Brief outline of my problem; I have created a Windows Service using VS2008 Professional that installs no problem under Windows XP using InstallUtil <service_name.exe> - The same code branch and attempting to use the same installation method under Windows 7 is ginving me headaches and I've spet the better part of 3 days trying to resolve this.

Snippet from the Service Install Log as below:

Code:
Installing assembly 'c:\Visual Studio 2008\Projects\NewService\NewService\bin\Debug\NewService.exe'.

Affected parameters are:
   logtoconsole = 
   assemblypath = c:\Visual Studio 2008\Projects\NewService\NewService\bin\Debug\NewService.exe
   logfile = c:\Visual Studio 2008\Projects\NewService\NewService\bin\Debug\NewService.InstallLog

Installing service NewService...

Creating EventLog source NewService in log Application...
Rolling back assembly 'c:\Visual Studio 2008\Projects\NewService\NewService\bin\Debug\NewService.exe'.

Affected parameters are:
   logtoconsole = 
   assemblypath = c:\Visual Studio 2008\Projects\NewService\NewService\bin\Debug\NewService.exe
   logfile = c:\Visual Studio 2008\Projects\NewService\NewService\bin\Debug\NewService.InstallLog
Restoring event log to previous state for source NewService.
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.
If anyone can help me figure out a way to get around this I'd be greatly appreciative... I don't want to do this from the VS command line as this is going to have to be packaged in an installer onto client machines.

TIA
Brendon
 


Solution
Brendon, it seems like you are encountering a security exception issue while trying to install your Windows service on Windows 7. The error message indicates that the source required for the event log is not found, and it's unable to access certain logs like the Security log. One possible reason for this could be related to the permissions required for Windows services on newer versions of Windows. Here are some steps and potential solutions you can try to resolve this issue: 1. Run InstallUtil as Administrator: - Make sure you are running the InstallUtil command as an administrator. Right-click on the Command Prompt or PowerShell and select "Run as Administrator" before running the installation command. 2. Grant...
Brendon, it seems like you are encountering a security exception issue while trying to install your Windows service on Windows 7. The error message indicates that the source required for the event log is not found, and it's unable to access certain logs like the Security log. One possible reason for this could be related to the permissions required for Windows services on newer versions of Windows. Here are some steps and potential solutions you can try to resolve this issue: 1. Run InstallUtil as Administrator: - Make sure you are running the InstallUtil command as an administrator. Right-click on the Command Prompt or PowerShell and select "Run as Administrator" before running the installation command. 2. Grant Permissions: - Check if the account under which the service is being installed has the necessary permissions. It requires administrative rights to create new event sources. 3. Modify Service Installer: - In your service code, ensure that you are checking for existing event sources before trying to create them. You can modify the installer code to handle this scenario. 4. Use Custom Actions: - If you are deploying this service using an installer package, you can add custom actions to handle the event log source creation during the installation process. This allows you to set up the event source with the necessary permissions. 5. Event Log Settings: - Ensure that the Event Log service is running and that the necessary logs are accessible. Check the Event Viewer to see if there are any issues related to logging. 6. Use Group Policies: - Check if there are any Group Policies in place that might restrict the creation of event logs. Adjust the policies accordingly if needed. 7. Update Code for Compatibility: - Windows XP and Windows 7 have differences in how services are handled. Make sure your service code is compatible with Windows 7 and its security features. Try these steps to see if they help resolve the security exception issue you are facing during the Windows service installation on Windows 7. If you continue to encounter issues, feel free to provide more details, and we can delve deeper into solving the problem.
 


Solution
Back
Top