473,511 Members | 15,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Single .EXE acting as Service or Application -- Possible?

Is it possible to create a single .EXE that can be launched either as a
service or as a standard application (with configuration screens, status
windows, etc...)?

I have an existing program that currently runs as a standard application.
When the user runs the app they can monitor its progress, review error logs,
and change configuration settings. I need to convert this program to run as
a service, but would like the user to retain the option of running it as a
standalone, interactive, application.

In a perfect world, the .EXE would be installed as a service, but if the
user clicks on the .EXE (or a shortcut) it would start in an interactive
mode.

Thanks!
Lee
Nov 20 '05 #1
2 1114
Lee,
I would consider having a parameter to the exe.

If the parameter is set, start as a service, if the parameter is not given,
start as a normal executable. Basically in your Sub Main, if the parameter
is given do the ServiceBase.Run else do Application.Run.

Ideally however I would create two executables. One for the UI that the user
would use, and a second for the service...

Hope this helps
Jay

"Lee Schipper" <la*@nospamlabapps.com> wrote in message
news:Mi******************@twister.socal.rr.com...
Is it possible to create a single .EXE that can be launched either as a
service or as a standard application (with configuration screens, status
windows, etc...)?

I have an existing program that currently runs as a standard application.
When the user runs the app they can monitor its progress, review error logs, and change configuration settings. I need to convert this program to run as a service, but would like the user to retain the option of running it as a
standalone, interactive, application.

In a perfect world, the .EXE would be installed as a service, but if the
user clicks on the .EXE (or a shortcut) it would start in an interactive
mode.

Thanks!
Lee

Nov 20 '05 #2
Lee,

In addition to what Jay mentioned about creating a separate executable for
the user interface, you could use remoting to communicate between the user
interface and service when you set configuration settings.

HTH,

Trev.
Nov 20 '05 #3

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

Similar topics

3
1612
by: Prabhu Shastry | last post by:
Hello group, I have a Windows Service and an application (C#). Both processes need access to a single dataset object (created and modified by the service and application will only read the...
9
23055
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
6
4942
by: ben | last post by:
I am needing a web service to be single threaded. Is this possible? Any ideas would be helpful
0
991
by: dfcoates | last post by:
I am hoping someone else has run into this before... Here's the situation: Win2K3 Server running a .NET Windows Service application. On the front end, the service is a TCP/IP host application...
6
2259
by: kumar_anil_gaya_India | last post by:
Hi All, I am facing one problem. I have one DLL called LogManagement which has ability to write to ExceptionLog and EventLog File. Both are separate file locate in Logs Diectory. I have two ...
1
1504
by: Dave Evans | last post by:
I have a number of remotable DLLs, which are hosted by a Windows Service. The Windows Service simply registers the remotable DLLs using RemotingConfiguration.Configure. The configuration file is as...
35
9298
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
3
15279
by: Reg | last post by:
Hello, Is it possible to create WCF Web Service that runs without IIS? Any tips how to do it? Cheers, Reg
7
7725
by: =?Utf-8?B?YWVzcGVy?= | last post by:
Is there such a thing as a single instance web service? Is it possible to have all calls to a web service share one property value by declaring it as static? I know web service should be stateless,...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7418
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.