Auto Start windows Application

  • Thread starter Thread starter DaveL
  • Start date Start date
D

DaveL

Hi All
I have a windows application that needs to run
24/7 in the SysTray

How to Start this on Start up When ever the machine is re-started etc

I also need to run as a Different User that has
Rights to do FileSystem and other work on this
Server

Thanks
DaveL
 
Hi All
I have a windows application that needs to run
24/7 in the SysTray

How to Start this on Start up When ever the machine is re-started etc

I also need to run as a Different User that has
Rights to do FileSystem and other work on this
Server

Thanks
DaveL


Dave,

One approach would be create two applications: a Windows service and a
WinForms application for the system tray. The Installer can setup the
Windows service to run under a privileged account not effected the the
current logged in user. The system tray application can provide the
user interface and communicate/interchange data with the Windows
service through .NET remoting or WCF depending on what version of .NET
you're using requirements call for on the target systems.

Reference:
[Building a system tray app in C#]
http://www.developer.com/net/csharp/article.php/3336751

[Creating a Windows Service in C#]
http://www.codeproject.com/KB/system/WindowsService.aspx

[From .NET Remoting to WCF]
http://msdn.microsoft.com/en-us/library/aa730857(VS.80).aspx
 
Hi All
I have a windows application that needs to run
24/7 in the SysTray

How to Start this on Start up When ever the machine is re-started etc

I also need to run as a Different User that has
Rights to do FileSystem and other work on this
Server

Thanks
DaveL

Forgot to add: In order to get the application into the system tray on
startup, just make sure the system tray application .exe is installed
to the users Startup folder. Alternatively there are also registry
entries you could make and some Installers provider an option to
handle this for you.
 
DaveL said:
I have a windows application that needs to run
24/7 in the SysTray

How to Start this on Start up When ever the machine is re-started etc

I also need to run as a Different User that has
Rights to do FileSystem and other work on this
Server

The SysTray only exists when a user is logged on to the computer, so this
is not the right place to run the application itself.

Instead, split the appliction in two:
- One part to do the actual work that needs to be performed 24x7. Build
ths application as a Windows Service. Configure the Installer to install
this service with the correct user settings, and to startup automatically.
If the user needs to be modified after the application is installed, an
Administrator can change it from Control Panel -> Administrative Tools ->
Services.
- Another part to allow user interaction with the service. This can be
built as a Windows Application that uses NotifyIcon to display itself in the
System Tray. It can communicate with the service through any adequate
interprocess communication method, such as Remoting. Install this
application into the Start folder, so it will run as soon as a user logs in.
 
Back
Top