{"id":4416,"date":"2018-03-01T07:09:56","date_gmt":"2018-03-01T15:09:56","guid":{"rendered":"https:\/\/www.coretechnologies.com\/blog\/?p=4416"},"modified":"2022-04-19T22:08:54","modified_gmt":"2022-04-20T05:08:54","slug":"legacy-desktop-application-questions","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/windows-services\/legacy-desktop-application-questions\/","title":{"rendered":"Wondering if Your Legacy Desktop Application Will Work as a Windows Service? Answer These 3 Questions to Find Out"},"content":{"rendered":"<div align=\"center\"><img loading=\"lazy\" decoding=\"async\" class=\"no-lazy-load imafe-padding\" src=\"\/blog\/images\/3-questions-to-ask.webp\" title=\"3 Questions\" alt=\"3 Questions\" border=\"0\" width=\"525\" height=\"190\" \/><\/div>\n<p>Does your old (but important) desktop application need to run all the time?<\/p>\n<p>Should it start immediately after a reboot, even when no one is there to log on and kick it off?<\/p>\n<p>If so, you should consider installing your program as a <a href=\"\/WindowsServices\/FAQ.html#WhatIsAWindowsService\" target=\"_blank\" rel=\"noopener noreferrer\">Windows Service<\/a> &#8212; the technology Microsoft invented to support mission-critical, 24&#215;7 applications. Use a &#8220;service wrapper&#8221; (like our <a href=\"\/products\/AlwaysUp\/\">AlwaysUp<\/a>) to install your application as a service in 5-10 minutes.<\/p>\n<p>But not all legacy applications will operate smoothly when installed as a service. Here are three questions you should ask to determine if a windows service is a good fit for your situation:<\/p>\n<ol style=\"margin-left:1.3em;padding:0;\">\n<li>\n<h2><b>Do you need to see (or interact with) your program while it&#8217;s running?<\/b><\/h2>\n<p>\nWindows services run in the background. Any windows displayed by a service appear on a &#8220;hidden desktop&#8221; called <a href=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Session 0<\/a>. When your legacy application is running as a service, <b>you will not see its windows on your own desktop.<\/b>\n<\/p>\n<p>\nAs a consequence, it doesn&#8217;t make much sense to run an intensively interactive application (like a word processor) as a windows service. Indeed, any application that demands your constant attention will be a poor fit. Does yours?\n<\/p>\n<p>\nBut if you only need to see your application from time to time, a service may still be an option because you can quickly <a href=\"\/products\/SwitchToSession0\/\" target=\"_blank\" rel=\"noopener noreferrer\">switch to the Session 0 desktop<\/a> whenever you need to see your application.\n<\/p>\n<p>\nFor example, when running <a href=\"\/products\/AlwaysUp\/Apps\/RunITunesAsAService.html\" target=\"_blank\" rel=\"noopener noreferrer\">Apple&#8217;s iTunes as a windows service<\/a>, here is what the Session 0 desktop looks like:<\/p>\n<div align=\"center\"><a href=\"\/products\/AlwaysUp\/Apps\/alwaysup-itunes-running-in-session-0-v8.0.jpg\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"iTunes as a Windows Service in Session 0\" target=\"_blank\"><img decoding=\"async\" src=\"\/products\/AlwaysUp\/Apps\/alwaysup-itunes-running-in-session-0-v8.0.jpg\" title=\"iTunes as a Windows Service in Session 0 (click to enlarge)\" alt=\"iTunes as a Windows Service in Session 0\" border=\"0\" width=\"520\" ><\/a><\/div>\n<\/p>\n<p>\nEven though there is no taskbar and the usual desktop icons have vanished, we can interact with iTunes just fine in Session 0. For example, we were able to add tracks to iTunes, create a playlist, and even change settings &#8212; just as we would if iTunes was running on our regular desktop.\n<\/p>\n<p>\n(The only exception is on Windows 10 and Windows 2016, where a particularly annoying bug will <a href=\"\/blog\/alwaysup\/alwaysup-windows-10\/\">prevent you from moving the mouse and keyboard in Session 0<\/a>. Come on Microsoft! Please fix this defect soon.)\n<\/p>\n<p>\nSo is occasionally switching to Session 0 good enough for your situation? If not, you should rule out a windows service.\n<\/p>\n<\/li>\n<li>\n<h2><b>Will your application occasionally prompt for input?<\/b><\/h2>\n<p>\nAn application that periodically pops up windows and expects you to respond can be a problem when installed as a windows service. Those popups\/windows will appear on the Session 0 desktop &#8212; effectively hidden from you. You will not know that your program is stuck waiting for you to enter a password or click the OK button!\n<\/p>\n<p>\nSo <b>a &#8220;needy&#8221; application is not a great candidate for running in the background<\/b> as a windows service. Does your legacy application fit the mold?\n<\/p>\n<p>\nHowever, if you only have to get past one or two prompts, our AlwaysUp service wrapper may provide an elegant solution. Simply write an automation script that dismisses the prompt and plug the script into AlwaysUp. <a href=\"\/products\/AlwaysUp\/AutoIt\/\" target=\"_blank\" rel=\"noopener noreferrer\">This page<\/a> dives into the details.\n<\/p>\n<p>\nFor example, when launching iTunes as a service, this error message is the first to appear:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/itunes-startup-error.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"iTunes Startup Error\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/itunes-startup-error.png\" title=\"iTunes Startup Error (click to enlarge)\" alt=\"iTunes Startup Error\" border=\"0\" width=\"391\" height=\"120\"><\/a><\/div>\n<\/p>\n<p>\nClicking the &#8220;X&#8221; in the title bar will expel the window and allow iTunes to start. To achieve the same effect when no one is around to click, we provided this <a href=\"\/products\/AlwaysUp\/Apps\/DismissITunesPrompts.au3\" target=\"_blank\" rel=\"noopener noreferrer\">simple one-line script<\/a> (which sends the &#8220;ESC&#8221; key to the iTunes window) to AlwaysUp. Now AlwaysUp automatically dismisses the warning on our behalf whenever it appears!\n<\/p>\n<\/li>\n<li>\n<h2><b>Does your application read from or write to files on a network drive?<\/b><\/h2>\n<p>\nLike a regular application, a windows service can access remote\/network devices. Permissions are granted based on the account running the service.\n<\/p>\n<p>\nHowever, <b>a service can&#8217;t use a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Drive_mapping\" target=\"_blank\" rel=\"noopener noreferrer\">mapped drive<\/a><\/b> &#8212; at least not without some extra work to explicitly map the drive letter.\n<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/map-netowrk-drive.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Mapping a Network Drive\" target=\"_blank\"><img decoding=\"async\" src=\"\/blog\/images\/map-netowrk-drive.png\" title=\"Mapping a Network Drive (click to enlarge)\" alt=\"Mapping a Network Drive\" border=\"0\" width=\"480\" ><\/a><\/div>\n<p>\nSo if your legacy application references network files via their full <a href=\"https:\/\/en.wikipedia.org\/wiki\/Path_(computing)#UNC\" target=\"_blank\" rel=\"noopener noreferrer\">UNC path<\/a> (like <nobr>&#8220;\\\\ServerName\\ShareName\\Path&#8221;<\/nobr>) it will be fine as a windows service. But if your program uses files via a mapped drive (like <nobr>&#8220;J:\\Path&#8221;<\/nobr>, where J is mapped to <nobr>&#8220;\\\\ServerName\\ShareName\\&#8221;<\/nobr>), a service may not be in your future.\n<\/p>\n<p>\nMapped drives may not be an issue when using AlwaysUp though. Most drives will be mapped and available to your application if you check the &#8220;Attempt to automatically reconnect all network drives&#8221; box on the <a href=\"https:\/\/www.coretechnologies.com\/products\/AlwaysUp\/alwaysup_startup_tab.jpg\" target=\"_blank\" rel=\"noopener noreferrer\">Startup tab<\/a> when configuring your application.\n<\/p>\n<\/li>\n<\/ol>\n<h2><b>Next step? Try it yourself!<\/b><\/h2>\n<p>\nIf none of these questions have ruled out your legacy\/desktop application, you should go ahead and try it as a windows service. Any service wrapper (like <a href=\"\/products\/AlwaysUp\/\">AlwaysUp<\/a>) will do the trick in a few minutes. What have you got to lose?<\/p>\n<!-- relpost-thumb-wrapper --><div class=\"relpost-thumb-wrapper\"><!-- filter-class --><div class=\"relpost-thumb-container\"><style>.relpost-block-single-image, .relpost-post-image { margin-bottom: 10px; }<\/style><h3>You may also like...<\/h3><div style=\"clear: both\"><\/div><div style=\"clear: both\"><\/div><!-- relpost-block-container --><div class=\"relpost-block-container relpost-block-column-layout\" style=\"--relposth-columns: 3;--relposth-columns_t: 2; --relposth-columns_m: 2\"><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/windows-service-vs-web-service\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: What&#039;s the difference between a Windows Service and a Web Service?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/windows-service-vs-web-service-150x150-1.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: What&#039;s the difference between a Windows Service and a Web Service?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/service-start-time\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"When did my Windows Service Start?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/windows-service-uptime-thumbnail.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">When did my Windows Service Start?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/gui-applications-as-windows-services\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"How to Run Your GUI Applications as Windows Services (Without Breaking Them)\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/run-gui-applications-windows-services-150x150-1.webp\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">How to Run Your GUI Applications as Windows Services (Without Breaking Them)<\/h2><\/div><\/div><\/a><\/div><!-- close relpost-block-container --><div style=\"clear: both\"><\/div><\/div><!-- close filter class --><\/div><!-- close relpost-thumb-wrapper -->","protected":false},"excerpt":{"rendered":"<p>Does your old (but important) desktop application need to run all the time? Should it start immediately after a reboot, even when no one is there to log on and kick it off? If so, you should consider installing your &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/legacy-desktop-application-questions\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4430,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[91,97,153,196],"class_list":["post-4416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-services","tag-interactive-services","tag-legacy-app","tag-session-0-isolation","tag-windows-services-2"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/4416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=4416"}],"version-history":[{"count":3,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/4416\/revisions"}],"predecessor-version":[{"id":11244,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/4416\/revisions\/11244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/4430"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=4416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=4416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=4416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}