• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

Windows Event Log record while Windows Service runs

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
Tom Knowlton
Asked:
Tom Knowlton
  • 11
  • 9
2 Solutions
 
Razzie_Commented:
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
 
Tom KnowltonWeb developerAuthor Commented:
I wrote the Windows Service myself.
0
 
Tom KnowltonWeb developerAuthor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Tom KnowltonWeb developerAuthor Commented:
Here is my Windows Service Code:

http://www.robotzgame.com/junk/ws_code.zip
0
 
Razzie_Commented:
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
 
Tom KnowltonWeb developerAuthor Commented:
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
 
Razzie_Commented:
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
 
Razzie_Commented:
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
 
Razzie_Commented:
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
 
Razzie_Commented:
that should be 9.0 instead of 10.0 of course.
0
 
Tom KnowltonWeb developerAuthor Commented:
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
 
a_goatCommented:
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
 
Tom KnowltonWeb developerAuthor Commented:


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
 
Tom KnowltonWeb developerAuthor Commented:
a_goat:

The Windows Service in question is logging in under the Administrator account........NOT as Local System.
0
 
Tom KnowltonWeb developerAuthor Commented:
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
 
Tom KnowltonWeb developerAuthor Commented:
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
 
Razzie_Commented:
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
 
Tom KnowltonWeb developerAuthor Commented:
I'm giving up on this for a while......I'm such a quitter.  :)
0
 
Razzie_Commented:
Well it's always hard to track down these kind of problems... hope you'll work it out in the near future.
0
 
Tom KnowltonWeb developerAuthor Commented:
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
 
Razzie_Commented:
Right :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 11
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now