Unable to properly set the InteractiveProcess property on a windows service



Hello,

I have written a windows service and created an installer for it.
The service runs under the system accounts. When started, it launches a
GUI.
By default, the InteractiveProcess property of the service is not set
(this can be checked by right-clicking on the service in the Services
window (Admin tools>Services), choosing Properties, LogOn tab). In
order to enable my service to launch a GUI at startup, I added the
following lines in my installer :

public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
SetInteractWithDesktop();
}


private void SetInteractWithDesktop()
{
RegistryKey fm;
ServiceType type;

fm =
Registry.LocalMachine.OpenSubKey(@"SYSTEM\CURRENTCONTROLSET\SERVICES\myserv",
true);
type = ServiceType.InteractiveProcess |
ServiceType.Win32OwnProcess;
fm.SetValue("Type", (int)type);
fm.Close();

}

This modifies the appropriate Registry key in order to enable the
InteractiveProcess property.

If I install this service and run it : it does not display my GUI.
However, if I check in Admin tools>Services>*myserv*Properties>LogOn
tab, I can see the box ticked for "Allow service to interact with
Desktop", which is the expected behavior.

Now if I untick and tick again this box, press ok, and start my
service, it works fine, displaying the GUI correctly.

I'm wondering whether the registry key Im changing when installing the
service, is the only one to be changed in order to enable interaction
with the desktop.

Any ideas that could help me ?

Cheers,

Tibo

.



Relevant Pages

  • Re: redhat vs debian
    ... But the lack of GUI engineering is glaring to anyone with any ... Distros like Debian are not for newbies. ... If I don't like the gates I don't go away. ... I am very specifically talking about the installer, ...
    (linux.redhat)
  • Re: Modern FreeBSD Installer?
    ... there is no fancy, easy, nice, modern and accessable installer. ... is a GUI installer via a serial line or by a blind user? ... Because FreeBSD is for both servers and desktops and mixed ... OS/ES for others, and later on, Linux; today, FreeBSD is my ...
    (freebsd-questions)
  • Re: Idea of a Debian Mascot [Was: FW: Bits from the DPL: FTP assistants, marketing team, init script
    ... fancy GUI tough to use, then I seriously doubt they are advanced enough ... to be using Debian. ... You do know Debian has a graphical installer, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Reinstalling Package modules on Madriva 10.2 after removing gtk
    ... The package installer is the gui interfaced tool that handles the ... In retrospect I should post this on a Mandriva specific group, ...
    (comp.os.linux.misc)