The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP]How to package and install a Windows Service with a Windows 10 UWP App RRS feed

  • Question

  • I've been messing around with the new UWP apps and am currently working on a design for a new app. Well, technically, a rewrite of an existing desktop application I wrote a while ago.

    I created a Proof of Concept which includes the following components:

    1. The UWP App
    2. A WCF Service Library
    3. A Windows Service which hosts the WCF service library

    The idea is that the Windows Service will be processing what it needs to, even if the UWP app is not running. This is a requirement. When the app is running, it can communicate with the Service via the WCF Service library and change settings and other things. All this is working.

    However, for this to actually work, when the user installs the app from the app store, the Windows Service will need to be nstalled and started on the machine.


    I want to use the UWP app so it can be easily discovered and possibly monetized in the App Store 

    How can I accomplish this? Thanks


    Monday, June 8, 2015 6:44 PM

Answers

  • Hmm.... So UWP would not be your best choice here.  One of the tenants of the UWP is that it is safe to install and cannot affect the system or other installed programs.  You are isolated from the system (for security reasons) and your design sounds like it is not a good candidate here.  You cannot install a global keyboard hook for what I think are obvious security reasons.  Thanks for trying though!  It just doesn't seem to fit within the restrictions of a typical Store App.

    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Monday, June 8, 2015 8:25 PM

All replies

  • Hi Neptune,

    Welcome to the Developing Universal Windows apps forum! 

    You cannot do this and deploy the app to the store.

    One thing you COULD do is create a WebService to host the parts you would have had installed locally on the box.  Without knowing more details, that is the best advice I can give.

    -Jeff


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)


    Monday, June 8, 2015 7:54 PM
  • Unfortunately, I can't use a WebService, because the Windows Service is required to intercept global hotkeys. The UWP app is just an interface to the service. But if I cannot submit to app store, then the next best thing is to fall back to WPF. But I really would rather begin developing Store Apps, and start leaving WPF in the dust.

    Can you think of any other way I can accomplish this?

    before I decide to fall back to WPF, I want to know a few things.

    1. Can UWP apps have a system tray icon?
    2. Can UWP apps always run in background to intercept hotkeys. ex: intercept the close button to just hide the app or something?

    If I can accomplish those 2 things, I can forget the Windows Service idea, and won't have to go the WPF route. But I think the Windows Store could use all the help it can get :)

    Monday, June 8, 2015 8:15 PM
  • Hmm.... So UWP would not be your best choice here.  One of the tenants of the UWP is that it is safe to install and cannot affect the system or other installed programs.  You are isolated from the system (for security reasons) and your design sounds like it is not a good candidate here.  You cannot install a global keyboard hook for what I think are obvious security reasons.  Thanks for trying though!  It just doesn't seem to fit within the restrictions of a typical Store App.

    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Monday, June 8, 2015 8:25 PM
  • Thanks,

    I do understand the limitations and why. So I guess I will just use WPF. I think, however, I like my service idea and will stick with that.

    I think I can still submit desktop apps to the App Store, although the user must go to the publishers site to download and install. Better than nothing, right? :)

    Monday, June 8, 2015 8:42 PM