Example of Use
This is a short tutorial which explain you how to install and configure a universal windows service as stand alone service due to a simple example.
We want to start a simple executable like the notepad every day at 16:00 o'clock for example.
Download and install
You have to download the latest version and install it running the setup.exe. Follow the instructions on the screen.
Configure a new service
After the files has been copied the Management Dialog will be started automatically to configure new services. The following picture will appear on the screen.
Now press the New button to create a new universal windows service. After that you have to enter some information for your universal windows service. As ServiceName enter "uws". DisplayName could be "Universal Windows Service" and as Description enter the value "A universal windows service for starting and watching executables.". You should also check the Interactive Process and Start service after installation checkboxes. Then press the OK button to start creation.
A new universal windows service will be installed on your computer and immediately starts its work. But there is nothing to do for the service because it has no configuration file to work. Therefore open a simple text editor like notepad and write the following settings down.
<uws> <!-- settings of the logging (using log4net) - see log4net documentation for further information --> <log4net> <appender name="File" type="log4net.Appender.FileAppender"> <file value="uws.log"/> <appendToFile value="true"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/> </layout> </appender> <logger name="uws"> <level value="ALL"/> <appender-ref ref="File"/> </logger> </logger name="Notepad"> <level value="ALL"/> <appender-ref ref="File"/> </logger> </log4net> <!-- configuration of the universal windows service by itself --> <application name="Notepad" enabled="true"> <executable> <path value="c:\winnt\notepad.exe"/> </executable> <triggers> <trigger type="uws.Triggers.DailyTrigger"> <time value="16:00"/> </trigger> </triggers> </application> </uws>
Now save this text file in the installation directory of your universal windows service (default would be C:\Program Files\CC-SE\Universal Windows Service) with the name of our service (here uws.config). After that the universal windows service recognise its new configuration file, load it and start working.
Every day at four o'clock the service would start one instance of the notepad.exe. You see it is very simple to set up a configuration file. Try it.