Service + Custom shell

8

84.jain

Hello All,

I am working creating a custom shell. I have few doubts regardnig this.

First and foremost I have created a service which on starting launches
the required appplication.
I was successful in installing this service compoent and starting when
ever the system boots.


e.g : My service application launches a simple notepad on starting of
the service.I was successful in creating this service as a OS
component.
Note : Every thing i triedwas in EXplorer shell.


Now i need to do the same using Custom shell.So is there any method to
Use this service as a custom shell.


since my service launches the required application for me there is no
need to add the custom shell.


Regards
Michells
 
K

KM

Michells,

You don't necessarily have to implement a shell for your image (Well, you will may have to leave with a few errors [tasks] in TD).
If the app launched from the service does what you need it can be the "shell" on your image.

Just keep in mind that if shell is implemented properly (Shell prototype) then Logon component takes some responsibilities on
managing some shell behavior. E.g., it can autorestart it if a proper registry entries are set.
With an app launched from a service you obviously lose that functionality.
Another thing to keep in mind that services are typically running in local service account context. To switch to a user account
you'd need to explicitly call some Win32 APIs (which you wouldn't need to do if you implemented a real custom shell app where Logon
component initializes user environment first and then launches the shell).
 
8

84.jain

Thank you KM,

If I am not wrong u mean " If I add the service component in my image
SLX there is no need of adding an shell compoennt!!" Is that right??
or u mean create a service component as a custom shell component.


I ahve few other doubts running in my mind. the following are these:

1) the service component created has the Group membership(in .sld file)
as "Software:system:management." how can i deal with it as a custom
shell??
2) If suppose I need to create my service as a Custom shell component
, what should be the Group membership(in .sld file)???

3) yes the service will launch the application, so as of now I am
adding the service component with explorershell . since my service
takes care of the application that i need then what sholud i type of
shell component do i need to add???



Regards
Michells
 
K

KM

Michells,

Yup, hat's what I meant. I don't know a ay how to make a custom shell component out of service unless you rewrite the service to be
more like a regular Win32 app (in other words, no reason to support SCM entrypoints).

As I mentioned, you can go without any shell at all. The service will be started anyway and will launch your app.
 
R

Richard

These are only my opinions, however I believe you will have more reliable
operation from a small GUI based application as shell then you will with a
service.

The reason I say this is that your GUI based shell application will have all
the permissions of the logged in user, weather it be a limited user or
Administrator, with will help avoid lots of pitfalls trying to launch
applications or access other items if you need to at a later time. The
Service will be logged in under the System Account and like KM stated, you
will most likely end up with permission issues sooner or later, or a lot of
coding to get around them.

Next, With the Service, unless the dependecies are set the service can
start before any of support system is up and running, causing you to loose
most of your hair. With the GUI Based Shell, your "almost" out of the
woods, using Slobodan's method, and a simple loop, you can wait until all
pending events are complete, then lauch your application.

Next, Service applications "normally" are not suppose to have a user
interface as part of the service. Normally it's recommended to have a
seperate application to communicate to/from the service.

If all you plan on doing is launching your main application then your shell
could be made very easily. Mine is a small form which shows the current
time, System UpTime, CPU Voltage, CPU Temperature and has a few buttons for
Enable and Disable EWF, Commit, Restart, Shutdown, Password to run a
command prompt. Nothing Fancy at all.

Hope this helps, ignore what you wish.
Richard
 
8

84.jain

Hello All,

I would like to thank all for your support.

I tried with just using only "windows logon" and "my service"
component.I removed Auto resolve option and started dependency check. I
got an error asking for including and one of the shells.
Command shell
Explorer shell
Shell prototype component
Task Manager shell

But I din't add any one of the above component.

then I my image was built without any problem. Next thing after FBA
process I was getting cmd.exe on booting along with my notepad(launched
by my service).

next thing is after my first boot the time taken by my service to
launch the application(i.e notepad) is more.
for the first time it takes very less time after that it takes more
time.

My Questions:
1) Even after removing the explorer shell component Y am i getting
command shell(cmd.exe).
2) Y there wil be a delay in launching my application after the
firstboot.if i see the services.msc right after th boot up i am able to
see my service but to start the service it is taking time!!! so please
help me out with this.

Regards
michells
 
K

KM

Michells,

It is not enough info about your project file(s) to help you fix the issues but I'll try to guess:
1) Are you sure the
"Command Prompt" and "Command Shell" components are not in the image?

Also, check the runtime's software registry hive the following key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon],"Shell"
What the value is set to?

2) I am not sure I understood this item quite. But I may guess you are experiencing a delay at the boot time until your service
is up and running and able to launch whatever app you need to launch from there. Is this correct?
That's the way services work. You obviously can't start a service before service manager is loaded.
This is why it would be better to rewrite your service to be more or like Win32 application so that it can be a regular
shell app.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top