Solved

Windows Event Log record while Windows Service runs

Posted on 2004-10-12
21
592 Views
Last Modified: 2007-12-19
I am getting consistent warning messages regarding MS Word when my Windows Service runs that uses MS Word:

Event Type:      Warning
Event Source:      MsiInstaller
Event Category:      None
Event ID:      1004
Date:            10/12/2004
Time:            10:05:13 AM
User:            N/A
Computer:      RADIUM
Description:
Detection of product '{00010409-78E1-11D2-B60F-006097C998E7}', feature 'OfficeUserData', component '{C9AF9050-C8BE-11D1-9C67-0000F81F1B38}' failed.  The resource 'HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\UserData' does not exist.
Data:


ALSO:


Event Type:      Warning
Event Source:      MsiInstaller
Event Category:      None
Event ID:      1004
Date:            10/12/2004
Time:            10:03:51 AM
User:            N/A
Computer:      RADIUM
Description:
Detection of product '{00010409-78E1-11D2-B60F-006097C998E7}', feature 'WordUserData', component '{8ADD2C93-C8B7-11D1-9C67-0000F81F1B38}' failed.  The resource 'HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\UserData' does not exist.
Data:




These error messages do not seem to STOP or PREVENT the Windows Service from running........nor do they seem to corrupt or affect the resulting WORD documents in any way.........yet still I get the warnings above with every attempt to use MS WORD.



Please help me figure out why this is happening and give me some advice as to how to get rid of this error message.



Thanks,

Tom
0
Comment
Question by:knowlton
  • 11
  • 9
21 Comments
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
Well, I think what happening might be normal. Did you write the service yourself?
Are you trying to read a value from a registry key and writing an error to the eventlog if the key is not found without terminating the service? (try-catch, and write the exception to the eventlog).
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
I wrote the Windows Service myself.
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
I do not knowingly access the Registry to do anything....but that does not mean that .NET isn't trying to do it in an effort to support COM.


I am not sure WHERE the attempt to read the registry is actually happening.

I'll post the code for the Windows Services.
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
Here is my Windows Service Code:

http://www.robotzgame.com/junk/ws_code.zip
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
I think this has something to do with Office trying to save settings. I found the following:
http://support.microsoft.com/default.aspx?scid=kb;en-us;298059

This is about OfficeXP but I'm sure it'll count for other versions too. Now, I know little about Office, but maybe you need to repair it, or you should look for some option related to the wizard mentioned in the article.
Maybe when you call Process.Kill() for WINWORD or something, the save your settings wizard, or some other related process that saves settings, automatically kicks in. Either way, I'm quite sure it's not your C# code doing anything wrong (since there is nothing that comes close to it looking at your code).
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
How did you link this article to my problem, exactly?

Or are you really just grasping at straws as to a reason?

No offense....just wondering how sure you are.
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
The article might not be the best explanation. It just serves as an indiaction that there might be an automatic process in Winword (or call it a wizard, hence the article) that tries to save data and settings. And the article clearly states that it tries to read some registry keys (including the ones you get the error on).

So when I see you terminate WINWORD, or whenever WINWORD is winning, it sounds quite logical to me that is trying to save settings. And again as the article says it tries to read certain registry keys for that. That's why I made the connection.

Now I'm absolutely NOT sure about that, but it might be an explanation, right? :)
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
Btw, it seems now that since the source is 'MsiInstaller' it might have something to do with Office trying to do an installation or repair.
If you start WinWord, does it prompt you, in any way, for some additional components to install, repair, anything?
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
Try creating a key HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\UserData with type of the key REG_DWORD and value 1. (taken from http://www.eggheadcafe.com/ng/microsoft.public.vstudio.setup/post272771.asp)
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
that should be 9.0 instead of 10.0 of course.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 5

Author Comment

by:knowlton
Comment Utility
I get something with Microsoft Visio from time to time  (not related to THIS problem).....but it like....tries to run a Visio install for no reason out of the blue.....

Just throwing that out there.
0
 
LVL 3

Assisted Solution

by:a_goat
a_goat earned 200 total points
Comment Utility
The problem is that services don't run as the System user (by default).  The System user has no HKEY_CURRENT_USER registry keys (you can't create them either).  The easiest fix would be to go into the service settings in the control panel and change it to run under your account.  That way it'll use YOUR user settings to load up whatever Word needs.  

It's nothing that repairing word or a clean install or anything along those lines should fix.
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility


I was incorrect about the Windows Service NOT crashing during the day....I apologize.  I watched the errors more closely today...and the Windows Service did indeed crash during the day.

See this screenshot:

http://www.robotzgame.com/junk/faxcomdie.gif


Here is the code block that generates the e-mail message....perhaps you can recommend some changes I can make to find out why the Windows Service is crashing?



private void CheckTrackingWS()
          {
               try
               {    
                   
                    lock(this)
                    {                        
                         FileInfo fi = new FileInfo("C:\\heartbeat\\tracker_alive.txt");
                         long _file = fi.LastWriteTime.Ticks;
                         DateTime _now = DateTime.Now;
                         TimeSpan ts = _now - fi.LastWriteTime;
                         
                         if(ts.Minutes >= 1)
                         {
                              genFuncs.SendMessage("tom@thebuyersfund.com","ALERT!!  FAX COM TRACKER SERVICE HAS DIED",ts.Minutes.ToString() + " minutes(s) since the last heart beat");
                              genFuncs.SendMessage("jasons@thebuyersfund.com","ALERT!!  FAX COM TRACKER SERVICE HAS DIED",ts.Minutes.ToString() + " minutes(s) since the last heart beat");

                              System.ServiceProcess.ServiceController myController =   new System.ServiceProcess.ServiceController("TrackBFRequests");

                              if (myController.Status == ServiceControllerStatus.Running)
                              {
                                   //stop the service if its running
                                   myController.Stop();                                  
                                   myController.Start();                                  
                              }
                              else if (myController.Status == ServiceControllerStatus.Paused)
                              {
                                   //continue the service if its paused
                                   myController.Continue();
                              }
                              else if (myController.Status == ServiceControllerStatus.Stopped)  
                              {
                                   //Start the service if its stopped
                                   myController.Start();
                              }
                              myController.Close();                              
                         }                    
                    }
                    //               throw new Exception("ERROR HANDLING TESTING");
               }
               catch(Exception eee)
               {
                    genFuncs.SendMessage("tom@thebuyersfund.com","WATCHDOG problem in method CheckTrackingWS","ERROR:  " + eee.ToString());
                    genFuncs.SendMessage("jasons@thebuyersfund.com","WATCHDOG problem in method CheckTrackingWS","ERROR:  " + eee.ToString());
               }    
          }
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
a_goat:

The Windows Service in question is logging in under the Administrator account........NOT as Local System.
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
I logged into the RADIUM server as the Administrator......I checked the Registry finally.....and sure enough...the KEY that the warning message talks about is in fact missing:

http://www.robotzgame.com/junk/UserData.gif



Is there any harm in CREATING the KEY manually?      Or is the problem more complex than that?
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
Well, under the Administrator account I tried creating the missing KEY information as is hinted at in this article:

http://www.eggheadcafe.com/ng/microsoft.public.vstudio.setup/post272771.asp



The MsiInstaller still complains that the KEY does not exist.  I even rebooted the RADIUM server to make sure....no luck.
0
 
LVL 8

Accepted Solution

by:
Razzie_ earned 300 total points
Comment Utility
Tom,

A couple of links in order of possible 'usefullness':

http://www.adminlife.com/247reference/msgs/18/90934.aspx
http://www.eventid.net/display.asp?eventid=1004&eventno=437&source=MsiInstaller&phase=1
http://www.dotnet247.com/247reference/msgs/44/223038.aspx
http://whirlpool.net.au/forum-replies.cfm?t=186755&r=2641695&u=26123

I can't test all this since I don't have the error. In addition, if nothing of the above helps, I guess reinstalling office would help.

Razzie
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
I'm giving up on this for a while......I'm such a quitter.  :)
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
Well it's always hard to track down these kind of problems... hope you'll work it out in the near future.
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
For now.....it is not a big deal......but when I decide to pursue this problem again....atleast I'll have a decent starting point, right?
0
 
LVL 8

Expert Comment

by:Razzie_
Comment Utility
Right :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now