Re: Make a Windows Service start a windows program.



Services aren't lauched when users logs in, services are lauched at system
start-up, Applications that depend on interactive logon session, should
never be implemented as Windows Services, they should be normal applications
that get started at logon (search for Autorun in windows help).

Only the UI portion of the app depends on an interactive logon. The service can start at system boot. I was thinking I could start it at user log on, but, as you say, that dependency is not what services are all about. good point.

The applications should run in separate processes, so you need a 'way' to
create remote instances of classes residing in a Winforms application. One
way is through remoting (assumed both are managed apps.) and another one is
through COM interop.
One question remain, what's the use of the object instance from the UI
applications perspective?

When the service instantiates the Project object from the class in the UI app (at predefined "run time" intervals), lots of IO stuff happens. From the UI app's perspective, this "run time" instance does not need to expose anything. The UI will retreive information about the results of the completed "project" from an XML file that the service logs to.

You said, the service creates an instance of class
'Project', how are you going to share the state between these two
applications?

That's a good question - is this possible only through remoting? As I mentioned above, the service will write to an XML file, so I can retrieve the project results from that, unless I can get these results from the state of the object instantiated by the service. But is that not possible when that instance was created by a separate thread? (the service and the UI are both managed)

Thanks for your comments - I'm still rather green with .NET and appreciate you insights. There may well be another way to do this, but a service is my preference because the IO stuff that need to be done is based on system up time, not user log-in time. And using a service gives me the separate thread so the user can work with the UI app while a project is running. Also, a Local Service has will have the required security context to perform the IO tasks at hand.

PS. The search matches I found for "Autorun" were for CDs and Pocket PC. Were referring to having a shortcut to the app in the windows startup folder?

.



Relevant Pages

  • Re: Themes & Colors
    ... The whole idea of Windows is to provide a consistent color ... If you change the color scheme, you change ALL applications. ... If you want to change the way your app looks color-wise, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Make a Windows Service start a windows program.
    ... |> Services aren't lauched when users logs in, ... |> start-up, Applications that depend on interactive logon session, should ... | Only the UI portion of the app depends on an interactive logon. ... | app, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Honestly Curious
    ... This is not a real-world problem, but I give you points for being creative enough to try and dream up an excuse for my moving an app *might* be a bad thing somehow. ... The registry however is the method Microsoft not only recommends for applications to use, but they require it for vendors to get the Windows logo on their packaging and marketing material. ...
    (comp.sys.mac.advocacy)
  • Re: user and group troubles
    ... change on the applications installation directory. ... to trace execution failure and discover where the app is throwing ... Microsoft MVP (Windows Server System: ... > giving the user local Admin rights on the said workstation. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Make a Windows Service start a windows program.
    ... Sounds to me like a normal application running with a notify icon rather ... start-up, Applications that depend on interactive logon session, should ... that get started at logon (search for Autorun in windows help). ... Only the UI portion of the app depends on an interactive logon. ...
    (microsoft.public.dotnet.languages.csharp)