Setting Up Microsoft Surface Service Applications
A Microsoft Surface service application runs in the background and interacts with Surface Shell, and it does not have a user interface. A service application might initiate user notifications (for example, about printing that is complete or network messages that have been received), or it might monitor the system or be used for continuous media operations.
|Because service applications persist across Surface Shell sessions (user sessions), make sure that previous user information is not exposed to subsequent users.|
Registering Service Applications
Each service application is registered in its own ApplicationName.xml file in the %ProgramData%\Microsoft\Surface\Programs folder, just like other Microsoft Surface applications. A service application's XML registration file contains a ServiceApplication element instead of an Application or AttractApplication element. For more information about the XML registration file for Microsoft Surface applications, see Registering Applications.
Starting Service Applications
Microsoft Surface starts service applications differently than other applications.
When a Microsoft Surface unit enters user mode, Microsoft Surface starts all registered service applications. When Microsoft Surface starts a service application, it runs the process without a console window so that the UI suppression functionality does not stop the service application. If a service application tries to run a GUI window, the Microsoft Surface platform suppresses any visible windows that the application creates and the Microsoft Surface unit might enter the out-of-order state. For more information about UI suppression in user mode, see Administrator Mode and User Mode.
Monitoring Service Applications
Microsoft Surface monitors service applications for failures (crashes) and restarts service applications if they crash or exit with a non-zero exit code. By default, a Microsoft Surface unit waits 10 seconds before it restarts a service application. You can change this delay through the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Surface\v1.0\Shell\ServiceApplicationRestartDelay registry value.
There is no limit on the number of times that the Microsoft Surface unit restarts a service application.
The Microsoft Surface platform does not restart services if they exit normally (with an exit code of zero), and it does not monitor if service applications stop responding (hang).