locked
[UWP][CX]Universal Windows App in C++/CX RRS feed

  • Question

  • Hello,

    I tried to create UWP application for Windows 10 in MS VS 2015 up3 C++/CX. If I launch it in Visual Studio

    using "Start with/without debugging" my application is running ok. But if I close VisualStudio and

    try to launch my application i.e. file App1.exe in Release directory I will obtain an Error Access Denied.

    WHY ? how can I launch my UWP application on my computer ?I DO NOT want to sell/send it to MS Store.

    Thanks

    Jerry


    • Moved by Baron Bi Monday, June 20, 2016 7:22 AM not about c++ development
    • Edited by Barry Wang Tuesday, June 21, 2016 1:56 AM title tag
    Saturday, June 18, 2016 5:35 PM

Answers

  • Hi ,

    UWP apps work in SandBox these apps can only run in context of an app container,( administrator mode don't affect) find your app in Start  Menu-> All apps  and click on Icon

    • Proposed as answer by Azat Tazayan Sunday, June 19, 2016 7:41 PM
    • Marked as answer by Jerry.Mouse Tuesday, June 21, 2016 10:54 AM
    Saturday, June 18, 2016 9:11 PM
  • Hi ,

    UWP apps work in SandBox these apps can only run in context of an app container,( administrator mode don't affect) find your app in Start  Menu-> All apps  and click on Icon

    oh, really? ... I did read a bit about UWP deployment methods ... and finally I understand why Microsoft is pushing UWP so hardly. ... they want to push us into their shop. So that they can make money with our sales and build up "customer loyalty" :-) ... the business model isn't that bad ... really ... it's some sort of hostage-taking through the back door, but hey ... as long as nobody says something. Why not? ... as soon as you don't want your Microsoft account anymore, you cannot use your software anymore. Great idea...

    http://www.businessinsider.de/epic-ceo-tim-sweeney-slams-windows-10-2016-3?r=US&IR=T

    [ latest news show that at least it seems, that there is a possibility, that Microsoft could change this in the future... but, I guess they will find other ways to "lock down" customers to their systems ]

    Rudolf



    • Edited by Rudolf Meier Saturday, June 18, 2016 10:20 PM
    • Marked as answer by Jerry.Mouse Tuesday, June 21, 2016 10:54 AM
    Saturday, June 18, 2016 9:57 PM

All replies

  • Do you run Visual Studio as administrator? (I normally do) ... in this case, your apps are launched as administrator too, when you're debugging.

    Otherwise... you should try to find out what causes the access denied. Try to monitor it with ProcMon.

    Rudolf

    Saturday, June 18, 2016 8:42 PM
  • Hi ,

    UWP apps work in SandBox these apps can only run in context of an app container,( administrator mode don't affect) find your app in Start  Menu-> All apps  and click on Icon

    • Proposed as answer by Azat Tazayan Sunday, June 19, 2016 7:41 PM
    • Marked as answer by Jerry.Mouse Tuesday, June 21, 2016 10:54 AM
    Saturday, June 18, 2016 9:11 PM
  • Hi ,

    UWP apps work in SandBox these apps can only run in context of an app container,( administrator mode don't affect) find your app in Start  Menu-> All apps  and click on Icon

    oh, really? ... I did read a bit about UWP deployment methods ... and finally I understand why Microsoft is pushing UWP so hardly. ... they want to push us into their shop. So that they can make money with our sales and build up "customer loyalty" :-) ... the business model isn't that bad ... really ... it's some sort of hostage-taking through the back door, but hey ... as long as nobody says something. Why not? ... as soon as you don't want your Microsoft account anymore, you cannot use your software anymore. Great idea...

    http://www.businessinsider.de/epic-ceo-tim-sweeney-slams-windows-10-2016-3?r=US&IR=T

    [ latest news show that at least it seems, that there is a possibility, that Microsoft could change this in the future... but, I guess they will find other ways to "lock down" customers to their systems ]

    Rudolf



    • Edited by Rudolf Meier Saturday, June 18, 2016 10:20 PM
    • Marked as answer by Jerry.Mouse Tuesday, June 21, 2016 10:54 AM
    Saturday, June 18, 2016 9:57 PM
  • Yes you are true [Azat Tazayan]. This works. My test App1 is "surprisingly" added to Start menu automatically.

    But what if I need to run my App1 from e.g. TotalCommander ? is it possible ?


     
    • Edited by Jerry.Mouse Sunday, June 19, 2016 6:03 AM update
    Sunday, June 19, 2016 5:29 AM
  • Hi ,

    UWP apps work in SandBox these apps can only run in context of an app container,( administrator mode don't affect) find your app in Start  Menu-> All apps  and click on Icon

    oh, really? ... I did read a bit about UWP deployment methods ... and finally I understand why Microsoft is pushing UWP so hardly. ... they want to push us into their shop. So that they can make money with our sales and build up "customer loyalty" :-) ... the business model isn't that bad ... really ... it's some sort of hostage-taking through the back door, but hey ... as long as nobody says something. Why not? ... as soon as you don't want your Microsoft account anymore, you cannot use your software anymore. Great idea...

    http://www.businessinsider.de/epic-ceo-tim-sweeney-slams-windows-10-2016-3?r=US&IR=T

    [ latest news show that at least it seems, that there is a possibility, that Microsoft could change this in the future... but, I guess they will find other ways to "lock down" customers to their systems ]

    Rudolf



    Rudolf Meier It means that you didn't read well about UWP . Keep your ambitions in you  

    Sunday, June 19, 2016 7:43 PM
  • Yes you are true [Azat Tazayan]. This works. My test App1 is "surprisingly" added to Start menu automatically.

    But what if I need to run my App1 from e.g. TotalCommander ? is it possible ?


     
    No It is impossible.
    Sunday, June 19, 2016 8:12 PM
  • Rudolf Meier It means that you didn't read well about UWP . Keep your ambitions in you  

    I don't think so... the only way of installing/using UWP whitout the store is by using them together with developer tools and/or settings.

    Sunday, June 19, 2016 10:18 PM
  • Hi Jerry,

    thanks for posting here.

    This forum is about c++ development. For your case which is about UWP, I will move your case to UWP forum for better help.

    Best Regards,

    Sera Yu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Monday, June 20, 2016 7:21 AM
  • @Jerry.Mouse,

    Just want to add one thing about uri or protocol. We can set the default protocol of our UWP app so that in other apps we can use LauchUriAsync to open our app. Like you can type "ms-chat:" to open a app.

    So here I haven't used the TotalCommander before, but if you use cmd, you can try this command:

    start ms-chat:

    In this way a UWP app can be opened from a URI.

    By the way, please notice that it is still trying to open an app that is already installed on your system. Not from your debug folder. This has already suggested by Azat. 

    Please see whether this helps.

    Best regards,

    Barry


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Barry Wang Tuesday, June 21, 2016 2:17 AM
    Tuesday, June 21, 2016 2:16 AM
  • I am confessing, that I totally DO NOT understand to MS new UWP philosophy ...

    really dont.

    Tuesday, June 21, 2016 10:51 AM
  • UWP is really imbecile idea.(understand like girlish idea)

    Just image, I am student and I need to create my semestral project. VS is great tool (supposing that it has no internal errors).  I need NO WindowsStore and I am not trying to sell my App to anyone. What now ? I will choose Linux/Android and I will dislike MS for ever. Optional/voluntary MS Store is great Idea (ok MS takes 30percent of price, it is a tax), because I can distribute my App in whole World. But, to restrict and lock-down absolutely everything to only this MS store systems is SENSELESS.


    • Edited by Jerry.Mouse Wednesday, June 22, 2016 12:28 PM update
    Tuesday, June 21, 2016 11:12 AM
  • I am afraid that I do not understand you. The command "start ms-chat:" starts on line chat with MS.

    There is no coincidence with my semestral project.

    I can give you one example from real world:

    US company http://eksobionics.com/  sold their Exosceleton system to our medical rehabilitatiive center in Kladruby town.

    https://www.novinky.cz/domaci/330893-sance-pro-vozickare-vojensky-system-eksoskeleton-nahradi-nohy.html

    Price of such system is 240000USD. Everything were paid using health assurance of people in our country. Such system can be made/constructed from scratch in our country for 4000USD. Supposing that control sw is constructed as MS UWP App. I must send such App to MS store. MS adds 30 percent to price of this App. And final user must download this app from MS Store via internet. So, all people in our country pay such overpriced sceleton from their health assurance and moreover they must pay +30 percent of App price. 240000USD is huge amount of money. Our health assurance will support research in USA, workers in USA, students in USA, MS in USA... etc. etc. But such huge amount of money destroys development, research etc. in our country. I thing that there is a lot of better ways how to rate/tax all sw which were made using MS VS.

    • Edited by Jerry.Mouse Tuesday, June 21, 2016 11:31 AM update
    Tuesday, June 21, 2016 11:15 AM
  • @Jerry,

    When you check your Package.appxmanifest you can define a protocol:

    It can be used to open your app, that is what I mean here. Your project can also use this feature to register a protocol.

    For details you can see here Handle URI activation

    Best regards,

    Barry


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 21, 2016 11:32 AM
  • Hi Jerry,

    It sounds like there are two unrelated subjects being discussed in this thread and a lot of confusion and inaccuracies.

    1. How to launch a UWP app that I've written?
    2. Can I distribute a UWP app without going through the store?
    <tl;dr>
    1. You can't directly launch the EXE. The appx package needs to be deployed. 
    2. You can deploy a UWP app without the store via side-loading. See Sideload apps in Windows 10
    </tl;dr>

    More details:

    For the first (launching): as has been said, the UWP app runs in a sandbox and so cannot be launched directly from the EXE. It has to be deployed and launched within its appropriate context not just run loosely. An app is normally launched by the user from the start menu (or equivalents). It can be launched programmatically through the IApplicationActivationManager interface, which is what Visual Studio and other test tools do under the covers. I don't know if TotalCommander implements this, but it definitely could.

    As Barry said, it is also possible to register your app to handle a custom URI and then launch it that way. This will let other apps, links, etc. launch the app with arguments, but doesn't give the launcher as much control over the app as IApplicationActivationManaager does (internally, the app launching the URI will generally call the shell to launch the app via IApplicationActivationManager::ActivateForProtocol). For more details on enabling your app to handle URIs see the Handle URI Activation documentation that Barry linked to.

    For the second (distribution): apps can be deployed without going through the store. This is called side-loading. The basic concept is that you-the-developer create your app package and sign it to prove that it came from you (and not some random villain pretending to be you). See Packaging Universal Windows apps for Windows 10

    You deliver the app package to your customer through whatever means you'd like (email, your web site, a USB stick, a stack of floppies, whatever), and your customer can set up their system to allow side-loading, to trust your signature, and install your app. See Sideload apps in Windows 10

    The goal is to prevent arbitrary untrusted apps from infecting the system. The admins of the system can choose if they want to run apps that didn't come from the store and which authors they want to trust.

    Typically enterprises manage side-loaded apps via some sort of Mobile Device Management.

    For more information on configuring your system for side-loading and deploying apps please see the TechNet Windows 10 IT Pro forums.

    Loosely related, a system can be set up for development testing, which is a less strict version of side-loading. This makes it easier to write and test apps, but isn't recommended for production.

    Tuesday, June 21, 2016 6:56 PM
  • Hello, thanks for info. I tried your "sideload" system (on C++/CX App created automatically) and I created the "package" but if I try to launch my app  Add-AppDevPackage.ps1 using "Run with PowerShell"  always obtain this "Unspecified error".

    What now ?

    1>------ Build started: Project: App5, Configuration: Debug ARM ------
    1>  pch.cpp
    1>  App.xaml.cpp
    1>  XamlTypeInfo.Impl.g.cpp
    1>  MainPage.xaml.cpp
    1>  XamlTypeInfo.g.cpp
    1>  App5.vcxproj -> C:\2\App5\ARM\Debug\App5\App5.exe
    1>  App5.vcxproj -> C:\2\App5\ARM\Debug\App5\App5.pdb (Partial PDB)
    1>  App5 -> C:\2\App5\ARM\Debug\App5\App5_1.0.1.0_ARM_Debug.appx
    1>  App5 -> C:\2\App5\AppPackages\App5\App5_1.0.1.0_Debug_Test\App5_1.0.1.0_ARM_Debug.appxsym
    1>  App5 -> C:\2\App5\AppPackages\App5\App5_1.0.1.0_Debug_Test\App5_1.0.1.0_x86_x64_arm_Debug.appxbundle
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    A package has been successfully built for Debug (x86).
    A package has been successfully built for Debug (x64).
    A package has been successfully built for Debug (ARM).
    ========== Package: 3 succeeded, 0 failed ===========
    An app bundle has been successfully built for Debug (x86), Debug (x64), Debug (ARM).
    ========== App Bundle: 1 succeeded, 0 failed ===========


    • Edited by Jerry.Mouse Wednesday, June 22, 2016 12:33 PM update
    Tuesday, June 21, 2016 7:29 PM