none
[UWP] [Desktop Bridge] Handling licensing RRS feed

  • Question

  • According to the docs we are supposed to remove our own licensing management from the app. However, there seems to be nothing to stop a user who knows what they are doing from copying the program files out of the installed UWP app package and running them as native Win32 apps elsewhere. If licensing has been removed, this seems to give them a freely copiable unprotected version of the program.

    How is licensing supposed to work? How can we make our Win32 app check that it is being run in a UWP container so that it can't be copied out?

    Wednesday, September 21, 2016 10:14 PM

Answers

  • For help getting your app ready for and approved for the store see https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge

    You'd call that namespace the same as you would any other Windows Runtime namespace from your Delphi app. The language will be the major difference here, not calling it from a Win32 app (other than that the store API depend on running in the app container and so won't run on an unconverted Win32 app). The mechanics are essentially the same as calling from a similar language UWP app. I'm not aware of any sample code in that language and you may need to go down to the COM level. There is higher level support for calling Windows Runtime classes from .Net and C++.

    • Proposed as answer by Martin Zhema Friday, September 23, 2016 2:27 AM
    • Marked as answer by Barry Wang Thursday, October 6, 2016 5:53 AM
    Friday, September 23, 2016 12:40 AM

All replies

  • once you converted your app to UWP you can call Windows Store APIs to check license status.



    Visual C++ MVP

    Thursday, September 22, 2016 3:04 AM
  • Thanks. Some googling brings up Windows.ApplicationModel.Store.CurrentApp.licenseInformation as the likely candidate.

    Is there a page with examples/more specific details on using this from a Win32 app? (though I suppose it's academic until the store actually accepts 3rd party apps). I'm particularly interested in calling from Delphi, previous experience suggests that calling WinRT APIs correctly can be very tricky, esp. given API interfaces tend not to exist.

    Thursday, September 22, 2016 9:43 PM
  • For help getting your app ready for and approved for the store see https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge

    You'd call that namespace the same as you would any other Windows Runtime namespace from your Delphi app. The language will be the major difference here, not calling it from a Win32 app (other than that the store API depend on running in the app container and so won't run on an unconverted Win32 app). The mechanics are essentially the same as calling from a similar language UWP app. I'm not aware of any sample code in that language and you may need to go down to the COM level. There is higher level support for calling Windows Runtime classes from .Net and C++.

    • Proposed as answer by Martin Zhema Friday, September 23, 2016 2:27 AM
    • Marked as answer by Barry Wang Thursday, October 6, 2016 5:53 AM
    Friday, September 23, 2016 12:40 AM
  • interfacing to winRT API is hard enough from C++ (you need either C++/CX syntax or WRL templates). Sorry I don't know much about Delphi... but if you could create a mixed project with C++ files in it, you could be going somewhere

    as for your other question "copying the program files out of the installed UWP app package", you can use GetCurrentPackageFamilyName early in your program. If it is running outside the package you can immediately fail

    Tuesday, November 1, 2016 6:32 AM