EventGhost as a service

Got a good idea? You can suggest new features here.
skat
Posts: 48
Joined: Thu Jun 23, 2011 10:11 am

Re: EventGhost as a service

Post by skat » Tue Aug 30, 2011 2:14 am

I did try to enable the destkop interaction in both but to no avail. What were your results molitar?

I did a bit of research on this now and think that due to the security changes since Vista, the interaction with desktop may not be possible: http://social.msdn.microsoft.com/forums ... d2ff1e3b1/

molitar
Experienced User
Posts: 212
Joined: Fri Sep 11, 2009 6:44 am

Re: EventGhost as a service

Post by molitar » Tue Aug 30, 2011 4:52 am

Ok I found a program that does work in Windows 7 because it allows you to change the Session 0 to console when it runs..

http://www.eltima.com/products/application-as-service/

skat
Posts: 48
Joined: Thu Jun 23, 2011 10:11 am

Re: EventGhost as a service

Post by skat » Tue Aug 30, 2011 7:34 am

Thanks molitar, I will have a look at eltima. It is quite expensive though.

In the meantime I have switched to using the Windows Task Scheduler where I can start EG when a user logs on and it runs under a specified user priviledges. Of course the problem is again the desktop interaction if you have a different user logging on than the one that EG runs under. For this I have now figured out a solution by using psexec (http://technet.microsoft.com/en-us/sysi ... 97553.aspx) to start EG under the Local System account and connect to user session 1:

Code: Select all

PsExec.exe -i 1 -d -s "C:\Program Files\EventGhost\EventGhost.exe"
Of course this does not restart the EG automatically if it hangs.

avalonai2
Posts: 5
Joined: Sat Jul 23, 2011 2:23 pm

Re: EventGhost as a service

Post by avalonai2 » Thu Sep 22, 2011 4:18 pm

Skat I found this srvman http://tools.sysprogs.org/srvman/ trying to find alternatives.
I've been using it on my WHS box and had no problems with it. There is a check box to run programs as services interactively.

I almost forgot to mention no install required.

This might do what you want.

skat
Posts: 48
Joined: Thu Jun 23, 2011 10:11 am

Re: EventGhost as a service

Post by skat » Fri Sep 23, 2011 12:53 pm

Thanks avalonai2. What did you put in the following fields?:
Service type
Start mode
Logon account

I left the Logon account empty and it automatically used "LocalSystem" account. Having ticked the Interactive service option, EG still does not show up.
I also tried another account but it says the account name or password is invalid and I can't get past that.

This is under Win7 64bit Home premium. Do you have WHS v1 or v2?

IIRC WHS v1 was based on Win Server 2003. As I mentioned previously MS introduced some additional security measures since Vista to disable desktop access from services.

eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: EventGhost as a service

Post by eatmeimadanish » Tue Oct 11, 2011 7:55 pm

Have you guys tried turning off Interactive Service Detection service (setting to disabled) and running http://www.codeproject.com/KB/system/xyntservice.aspx

I will try this when I get home.

cfull1
Experienced User
Posts: 124
Joined: Thu Aug 19, 2010 4:52 am

Re: EventGhost as a service

Post by cfull1 » Wed Oct 12, 2011 5:45 am

eatmeimadanish let me know how it goes. I just got application as service and I get the view message pop up from interactive service detection. I can switch between EG and everything else...but it's a pain.

eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: EventGhost as a service

Post by eatmeimadanish » Wed Oct 12, 2011 7:09 am

I only had time to test in windows XP. This is what I found (so far successful)
I setup my ini file like this using XYNT ( http://www.codeproject.com/KB/system/xyntservice.aspx ):

[Settings]
ServiceName = XYNTService
CheckProcessSeconds = 30
[Process0]
CommandLine = c:\eventghost\eventghost.exe -f c:\eventghost\test.xml
WorkingDir= c:\eventghost\
PauseStart= 1000
PauseEnd= 1000
UserInterface = Yes
Restart = Yes
UserName = User1
Password = Password1

What I did:
I launched it just plain, and EG was loaded but nothing seemed to work. So I added my user name and password (so it would launch in that instance) and that worked.
EG launches, but nothing appears on desktop despite Userinterface and Interact with desktop enabled. HOWEVER, the webserver rendered the page and events were sent back and forth. I then logged off... and low and behold it still worked. I logged back in and EG never skipped a beat.

I still need to test this in Windows 7, but I think this resolves this issue. Best part was it was brainless to install and completely opensouce. What its doing is running the process in a user space, but launched via the session defined as user. Maybe we can open this app up and port it into EG itself... just an idea!

eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: EventGhost as a service

Post by eatmeimadanish » Wed Oct 12, 2011 3:20 pm

Tested in Windows 7. Works!

What i have found so far using this method:

I can adjust my system volume via a web slider, so I know EG is recieving events (despite no EG icon or window display). I even sent AJAX calls and it recieved that. I could not get the desktop OSD to work, despite being logged in as the same user the EG instance is opened in.

After further testing I found that if I launched XBMC during startup, it would fail to launch (the exe would launch and die). I imagine this is because whatever level EG is running in, its spawning user processes in that as well, XBMC fails to render the screen and closes. Also the keyboard plugin would not work with EG, even with EG logged in as the same user. So EG works, but because its in a different user space without a desktop, its limited to only network and system level commands. I have not had a chance to really get into this but, its a good start.

skat
Posts: 48
Joined: Thu Jun 23, 2011 10:11 am

Re: EventGhost as a service

Post by skat » Sat Oct 15, 2011 1:25 am

eatmeimadanish wrote:I could not get the desktop OSD to work, despite being logged in as the same user the EG instance is opened in.
This is a show stopper for me. For the moment I am sticking with the psexec method mentioned above that works quite well on Win7.

eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: EventGhost as a service

Post by eatmeimadanish » Mon Dec 19, 2011 11:11 pm

You would not have to be logged in for EG to run, and EG runs despite whichever user logs in.

mkanet
Posts: 16
Joined: Mon Jun 11, 2018 12:53 am

Re: EventGhost as a service

Post by mkanet » Thu Jul 09, 2020 7:48 pm

When I try to run EventGhost via psexec, it won't start. It says it's looking for a file (which doesn't say which one).

PsExec.exe -i 1 -d -s "C:\Program Files (x86)\EventGhost\EventGhost.exe"

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com


PsExec could not start C:\Program Files (x86)\EventGhost\EventGhost.exe on MYPC:
The system cannot find the file specified.

jachin99
Experienced User
Posts: 646
Joined: Sat Feb 13, 2016 8:39 pm

Re: EventGhost as a service

Post by jachin99 » Fri Jul 10, 2020 2:31 am

Why not create a scheduled task that starts EG when the computer starts up as mentioned earlier in this thread? If you want to use an external program anyway, then you can look at the Non sucky service manager, or NSSM as well.

Post Reply