Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

with Visual Studio, I created a Windows service, using the appropriate "template". I made small changes to personalize the service. It does a few things (I need it only as an example): Writes to a dedicated log in the "EventLog" object and additionally adds a record to a file every time the "OnTimer" event occurs (every 5 min.). I then registered the service through the "Installutil" utility. It works perfectly.
The problem is that I wish it worked under Windows PE as well.

What I have tried:

To this end, I replicated the same settings in the WPE Registry (copying even, even, the Windows ones), but there is no way to make it work here. The service is present in Task Manager, but the state is "Stopped".
What strikes me is that there are many services active (i.e. running) in WPE environment. I also own some OEM manufacturer installation DVDs as well, where in the Windows PE environment, customized services are performed, that means the operation can be done. Where am I doing wrong? Thank you all.
Posted
Updated 2-Jul-23 0:56am
Comments
Dave Kreskowiak 2-Jul-23 11:16am    
There is no way to tell without seeing the code.

Windows PE is a very cut-down version of Windows. You may be doing something or using an object in your code that can work fine in normal Windows, but cannot be done or does not exist in PE.

1 solution

I do not have Windows PE, so I can't work the problem.

If I was to debug this, I would strip it back to the bare minimum until you get it running, then gradually turn the bits on until you identify what is causing the service to not start.
 
Share this answer
 
Comments
Luciano Pietrantonio 3-Jul-23 11:27am    
Sounds like a good suggestion, but it might not be enough.
Windows PE is offered by Microsoft for OEM manufacturers, but there is little or no documentation. Really hard to figure out what could be the cause.
Thank you.
Graeme_Grant 3-Jul-23 11:33am    
Won't know until you try.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900