473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Launch app from a Windows Service

Not only does the "solution" have a service app and installer, it has a Tray
Icon app that allows a user to send custom commands to the service.

The installer launches the service and the tray app in the commit phase.
The service app is automatic, so it is up and running whenever the computer
reboots. However, I need the tray app to be launched automatically, also.

The installer uses Process.Start("C:\MyPath\MyApp.exe") to launch the tray
app, which works fine.

The service app uses the same thing in its "OnStart" code, but it does not
work there. No errors, it just does not work. I write to the event log just
before and just after Process.Start, so I can confirm that the code path is
executed.

What do I need to do to have my service app start the tray app when the
service is started?

(The tray app uses a mutex to prevent muliple copies of the tray app).

Thanks,
Sep 17 '07 #1
2 2191
Hello Jon,

which operating system version are you deploying your service to? Based on
your message, I'd assume it could be Windows Vista.

If so, you need to be aware of new service hardening features in Vista:

http://www.microsoft.com/technet/tec.../SecurityWatch

In case of Vista, you could in fact start your tray application from your
service (thus no error messages), but since the tray application would then
run in a different session, the user wouldn't see the tray icon. See also
here:

http://blogs.msdn.com/oldnewthing/ar...8/2470754.aspx

My suggestion is that you would separate the starting of the service from
starting the tray application, and make the tray application start for
example by using the regular Start/Startup folder, for example.

Hope this helps.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Sep 19 '07 #2
Thank you very much.
which operating system version are you deploying your service to? Based on
your message, I'd assume it could be Windows Vista.
Windows XP
Nevertheless, what you said makes sense. The service operates in
LocalSystem, so the app it launches might not be visible to the normal user
id.
My suggestion is that you would separate the starting of the service from
starting the tray application, and make the tray application start for
example by using the regular Start/Startup folder, for example.
I have been trying that, but have been unable to get the installer to put
the right shortcut into the startup folder (and onto the desktop). It LOOKS
like the right thing, but the shortcut launches an installation procedure
instead of the tray app.
Sep 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Caroline | last post by:
I'd like to launch an executable file from a web page. Basically, the user enters seven parameters and then clicks a button to generate a graph. The input is written to a file and then read by...
1
by: Michael Howes | last post by:
I have a c# windows form that talks to a web service on a server that then can talk to multiple "agents" on different machines using web service calls. I want to be able to launch an application...
13
by: Ole Hanson | last post by:
Hi I am in need of a way to launch my WinForms-app (app.exe) just by pressing a keyboard combination like (Ctrl-Alt-P). This functionality should be present "out of the box" after the app...
4
by: cyshao | last post by:
Why Windows doesn't allow to launch daemon/service in command line ?? Unix/Linux can simply do that....
1
by: pberna | last post by:
Dear all, I possible to create a web service that launch a Windows Graphics .exe application (like notepad.exe, for example) installed on a remote server though a Web Service. If yes, what are...
3
by: Franck | last post by:
Hi, Got a windows Service which run under LOCAL SYSTEM account. Its main goal is to printout xls file to pdf. It seems that LOCAL SYSTEM account has not enough rights to do that (as launching...
1
by: Fabio R. | last post by:
Hi, I have a windows service that do some check every hour, calling a webservice in my app. Now I need to upload my app on a shared hosting and I can't install my windows service, so I need...
2
by: Steven.Xu | last post by:
how to launch .exe file when windows starting?
8
by: r0g | last post by:
Hi There, I'm trying to migrate a locally hosted page from windows to a private Ubuntu development server and one of the key bits of functionality (which used to work fine in Windows) was the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.