?
Solved

Packaging a 'system' service for NT/2K

Posted on 2002-03-19
8
Medium Priority
?
142 Views
Last Modified: 2011-09-20
I have developed an app - which runs fine as a service, but I would like to make it a 'system' service that runs immediately after boot (no user login required).

I have tried the obvious, (start=automatic), but this only provides a start event after a user logs in...

I will start this off at 100 pts for a straight answer to get my app running as a system bootup service, but will add (100 each) for the two following enhancements.

option 1)  After boot/start service...   display a systray icon - indicating the service status for any logged-in users

option 2)  Allow a maintenance applet to be run by an adequately authenticated user to display forms / modify states / pause/stop the service.

0
Comment
Question by:superchook
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6881296
What do you mean it only provides a start event? What is a start event? AFAIK no matter which user you run the service as, if you set it to automatic, it will start with Windows, regardless of whether someone logs in. You should note that it is possible to log into windows before all services have had time to start, maybe this is the behaviour you are experiencing?

Zaphod.
0
 
LVL 1

Author Comment

by:superchook
ID: 6881317
Sorry - my mention of a 'start event' was referring to the NTService_Start 'pseudo event' exposed by the NTService.ocx control.

From what I can understand, this is fired when the app is launched by the NT service manager.

Your comment about late start vs login is appreciated... I did consider it, but will check again when I'm in front of the machine later today.  I honestly didn't wait very long... and I know that some system tasks take quite a while to complete after bootup.
0
 
LVL 1

Author Comment

by:superchook
ID: 6881629
Z_Beeblebrox ...

No - the service just isn't starting...
In fact - my earlier observations were on an earlier development version... coded in a completely diferent way.

The current EXE will install and uninstall as a service...  will manually start & run properly as a service (or as a desktop application) - but will NOT auto start under any conditions as a service.

If the setting is Manual or Automatic, it appears in the list of services as 'blank' status (i.e. not 'Started'), and waits for me to START it manually.

Once started, it hides away in the background and does exactly what it should.


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 6881661
Hi,

Is anything getting logged to the event log? If not, the only thing I can think of is that for some reason your service is crashing after it registers itself as started with the Service Control Manager. If this happened, then the scenario you describe would occur. Some reasons that it might crash are that it tries to access a network resource before it is available, it tries to access another service before that service has started...

Hope that helps.

Zaphod.
0
 
LVL 1

Author Comment

by:superchook
ID: 6881677
Aha ! that's possible...
I'll look into that and perhaps put a delay in to the initialisation.  Answer tomorrow

The app actually initialises and starts TWO Media Encoder instances - one to a TCP/IP port, and another to a local file.  So it has a fairly large hit on resources during startup.

Perhaps the networking isn't up yet - when it tries to start.. I had assumed that user added services would only be started after the OS was stable.. ??
0
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 300 total points
ID: 6881687
Honestly I don't know what guarantees there are about resource availability on startup.

Zaphod.
0
 
LVL 1

Author Comment

by:superchook
ID: 7036282
Sorry for the delay in responding...

As it turns out, one of the OEM drivers I am using has it's config stored in the CURRENT_USER keys of the registry.  Of course - before login, there is no current user - so the driver fails, and passes it's problen back up the chain i.e. the service fails.

As the answer was not a definitive solution, but you did help me look in the right places...

0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
ID: 7036294
Thanks,

Zaphod.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

801 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