Re: Make a Windows Service start a windows program.




"deko" <deko@xxxxxxxxxx> wrote in message
news:qf2dnWoPNv6WOWHeRVn-sg@xxxxxxxxxxxxxx
|> The OP's question relates to a "windows" program, not a console style
| > program. Note that the same remark about the user profile applies when
| > starting a console application, an application that considers it's
profile
| > being loaded when started will fail if started from a service.
| > In general, services should not start other applications, unless you
have
| > full control of it's UI and profile context.
|
| What do you mean when you say:
|
| > "unless you have full control of it's UI and profile context"?
|

Well I mean that it's possible for the program that gets launched from a
Windows Service session, to load the environment and profile of an
interactive user, it's also possible to migrate the current desktop to the
(visble) interactive desktop, but this is not a trivial task and requires
some thorough understanding of the OS security system.


| I have a similar situation where a service needs to instantiate an object
| contained in a WinForms app. The service and the app are installed as a
| pair; the UI is used to define the action taken by the service at
| pre-defined intervals.
|

I suppose you mean instantiate an object through remoting right? This is not
a problem as long as the WinForms app is started from an interactive logon
session and not from the service.


| When constructing the assembly in Visual Studio that contains the
| application/service pair, should the service and the app be in a separate
| namespaces? Does it make any difference? The design goal is to keep the
| service and the app a loosely coupled as possible since they run in
| different security contexts.
|

Namespace are irrelevant here, what matters is the assemblies, both your
service and the WinForms app. should reside in a separate assembly.

Willy.


.



Relevant Pages

  • Using the ASP.NET 2.0 Profile in WinForms
    ... I was able to utilize Profile in the WinForms ... How does ASP.NET create this ProfileCommon class - does it ... the strongly-typed ProfileCommon class in my WinForms app? ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Exchange Server Reported Error 0x8004011d
    ... Create the computer account by running the Add Computer Wizard. ... Save the domain user profile. ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: embeded source changed
    ... drive with Win2K profile to new with WinXP and worked until and my WMP ... Get places like network adapter setting and user profile can be ... need to have access to hidden folder within a profile. ... Har har hardy har har! ...
    (alt.html)
  • RE: good question for a good XP guru!
    ... When you overwrite the default user profile with another profiles such as ... links and pointers back the "sysprep" profile locations. ... >local administrator and copy sysprep's user profile to the Default Users's ... The error does not occur when done as THE local administrator. ...
    (microsoft.public.windowsxp.setup_deployment)
  • RE: Roaming Users Local Profile
    ... Changes to your roaming profile are lost after every reboot. ... use same user account to log on different Windows XP pro computers ... How to assign a mandatory user profile in Windows XP ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)

Loading