473,811 Members | 3,521 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 1126
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*@nospamlaba pps.com> wrote in message
news:Mi******** **********@twis ter.socal.rr.co m...
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
1621
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 dataset). I thought this was possible with ..Net remoting, but not able to figure out a way to make this possible. Does anyone know if it's possible to achieve this? Thanks, -Prabhu
9
23088
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 to a pool. If I assign only one application to a applicaton pool and have multiple worker processes assigned to that pool. Will my application be processed by many worker processes?
6
4964
by: ben | last post by:
I am needing a web service to be single threaded. Is this possible? Any ideas would be helpful
0
1001
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 and will receive requests via one or more socket connections. On the back end, we would like each request to be handled by having the service connect to a web service at a specific location. At each
6
2272
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 windows service application and one windows application which call the LogManagement DLL to write to log file. I made the object of LogManagement as Singleton but when I run single application, It runs perfect, but when I run
1
1522
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 follows: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.remoting> <application name="UniConnect"> <service> <wellknown mode="SingleCall" type="Northgate.HRS.UniConnect.UCRegistry, ZUCRegistry"...
35
9369
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 500000 to 3200000 of a file whose size is say 20MB... how do i request a download which starts directly at 500000th byte... thank u cheers
3
15300
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
7739
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, but I am still trying to understand how instances of a web service are handled at the server side, if a unique instance is created for every call then should'nt any members declared as "static" be shared between instances? Any help is ...
0
10647
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10395
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7667
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5553
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.