How to convert application URI to normal file path?How to convert std::string to lower case?How to convert a std::string to const char* or char*?Normalize file path with WinAPIHow to convert int to QString?How can I convert a std::string to int?How do I access the RoamingState folder of an UWP when it calls my DLL?How to properly structure UWP app icons in AppxManifest.xml file for a Win32 app converted using Desktop Bridge (Project Centennial)Convert URI to pathIs there a desktop mechanism similar to UWP windows.protocol?Opening Files from a String Path with Android NDK

Why does the headset man not get on the tractor?

Why do the lights go out when someone enters the dining room on this ship?

What makes "quality" analog AV cables better than cheap cables?

How do employ ' ("prime") in math mode at the correct depth?

Why is it harder to turn a motor/generator with shorted terminals?

How to cope with regret and shame about not fully utilizing opportunities during PhD?

What's tha name for when you write multiple voices on same staff? And are there any cons?

Where to find every-day healthy food near Heathrow Airport?

How can a layman easily get the consensus view of what academia *thinks* about a subject?

Would an 8% reduction in drag outweigh the weight addition from this custom CFD-tested winglet?

Conditional probability - sum of dice is even given that at least one is a five

Jumping frame contents with beamer and pgfplots

What is the largest number of identical satellites launched together?

Does Lawful Interception of 4G / the proposed 5G provide a back door for hackers as well?

Is this a security concern for ubuntu users?

What kind of SATA connector is this?

Will a coyote attack my dog on a leash while I'm on a hiking trail?

Is Germany still exporting arms to countries involved in Yemen?

Wireless headphones interfere with Wi-Fi signal on laptop

Is there ever any indication in the MCU as to how Spider-Man got his powers?

CPLD based Pierce oscillator

Anatomically Correct Carnivorous Tree

Does gravity affect the time evolution of a QM wave function?

What are the implications of the new alleged key recovery attack preprint on SIMON?



How to convert application URI to normal file path?


How to convert std::string to lower case?How to convert a std::string to const char* or char*?Normalize file path with WinAPIHow to convert int to QString?How can I convert a std::string to int?How do I access the RoamingState folder of an UWP when it calls my DLL?How to properly structure UWP app icons in AppxManifest.xml file for a Win32 app converted using Desktop Bridge (Project Centennial)Convert URI to pathIs there a desktop mechanism similar to UWP windows.protocol?Opening Files from a String Path with Android NDK






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















How can I obtain normal file path from application URI given that I'm aware of application / package id?




ms-appx:///assets/Logo.png

ms-appdata:///local/Packs/area1.dat




PathCreateFromUrlW obviously does not work. I think for UWP applications there is a crippled method to obtain a path for current application by creating an instance of storage file object using IStorageFileStatics::GetFileFromApplicationUriAsync and then invoking IStorageItem::get_Path.










share|improve this question
























  • Whatever you are going to do next is not going to work.

    – Hans Passant
    Mar 23 at 19:18


















2















How can I obtain normal file path from application URI given that I'm aware of application / package id?




ms-appx:///assets/Logo.png

ms-appdata:///local/Packs/area1.dat




PathCreateFromUrlW obviously does not work. I think for UWP applications there is a crippled method to obtain a path for current application by creating an instance of storage file object using IStorageFileStatics::GetFileFromApplicationUriAsync and then invoking IStorageItem::get_Path.










share|improve this question
























  • Whatever you are going to do next is not going to work.

    – Hans Passant
    Mar 23 at 19:18














2












2








2








How can I obtain normal file path from application URI given that I'm aware of application / package id?




ms-appx:///assets/Logo.png

ms-appdata:///local/Packs/area1.dat




PathCreateFromUrlW obviously does not work. I think for UWP applications there is a crippled method to obtain a path for current application by creating an instance of storage file object using IStorageFileStatics::GetFileFromApplicationUriAsync and then invoking IStorageItem::get_Path.










share|improve this question
















How can I obtain normal file path from application URI given that I'm aware of application / package id?




ms-appx:///assets/Logo.png

ms-appdata:///local/Packs/area1.dat




PathCreateFromUrlW obviously does not work. I think for UWP applications there is a crippled method to obtain a path for current application by creating an instance of storage file object using IStorageFileStatics::GetFileFromApplicationUriAsync and then invoking IStorageItem::get_Path.







c++ winapi windows-10






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 17:58







VTT

















asked Mar 23 at 13:23









VTTVTT

27k42651




27k42651












  • Whatever you are going to do next is not going to work.

    – Hans Passant
    Mar 23 at 19:18


















  • Whatever you are going to do next is not going to work.

    – Hans Passant
    Mar 23 at 19:18

















Whatever you are going to do next is not going to work.

– Hans Passant
Mar 23 at 19:18






Whatever you are going to do next is not going to work.

– Hans Passant
Mar 23 at 19:18













1 Answer
1






active

oldest

votes


















2














There is a workaround:



You can use GetPackagePathByFullName to get the UWP application install path using PACKAGE_ID.
The path will like this C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe.



If you want a path of file under assets the path will be C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbweAssetsLogo.png



Sample code:



GetPackagePathByFullName(L"Microsoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe", &path, buffer);


More reference: "Package query API"






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314165%2fhow-to-convert-application-uri-to-normal-file-path%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    There is a workaround:



    You can use GetPackagePathByFullName to get the UWP application install path using PACKAGE_ID.
    The path will like this C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe.



    If you want a path of file under assets the path will be C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbweAssetsLogo.png



    Sample code:



    GetPackagePathByFullName(L"Microsoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe", &path, buffer);


    More reference: "Package query API"






    share|improve this answer



























      2














      There is a workaround:



      You can use GetPackagePathByFullName to get the UWP application install path using PACKAGE_ID.
      The path will like this C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe.



      If you want a path of file under assets the path will be C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbweAssetsLogo.png



      Sample code:



      GetPackagePathByFullName(L"Microsoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe", &path, buffer);


      More reference: "Package query API"






      share|improve this answer

























        2












        2








        2







        There is a workaround:



        You can use GetPackagePathByFullName to get the UWP application install path using PACKAGE_ID.
        The path will like this C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe.



        If you want a path of file under assets the path will be C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbweAssetsLogo.png



        Sample code:



        GetPackagePathByFullName(L"Microsoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe", &path, buffer);


        More reference: "Package query API"






        share|improve this answer













        There is a workaround:



        You can use GetPackagePathByFullName to get the UWP application install path using PACKAGE_ID.
        The path will like this C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe.



        If you want a path of file under assets the path will be C:Program FilesWindowsAppsMicrosoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbweAssetsLogo.png



        Sample code:



        GetPackagePathByFullName(L"Microsoft.SDKSamples.ListView.CS_1.0.0.0_x64__8wekyb3d8bbwe", &path, buffer);


        More reference: "Package query API"







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 6:33









        Rita Han - MSFTRita Han - MSFT

        5,4241313




        5,4241313





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314165%2fhow-to-convert-application-uri-to-normal-file-path%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

            밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

            1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴