locked
Creating a folder under AppX on runtime

    Question

  • Hi,

    Is it possible that a Windows Store App creates a folder under AppX where the application deployed on runtime?

    When I simply try with:

    Windows::ApplicationModel::Package::Current->InstalledLocation->CreateFolderAsync(),

    I get the error code, 0x80070005, which means "access denied".

    By the way, I could copy files to the InstalledLocation.

    Thanks,

    Guile

    Friday, January 4, 2013 5:43 AM

Answers

  • Hi Guile,

    Your app does not have write access to its installed location. Instead store runtime data in your application data folders. See http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464917.aspx for more information.

    Your file copies are working because the app isn't installed: you are running it uninstalled from the project directory, which you do have access to. When it is filly deployed it will be installed in Program Files with limited access rights.

    --Rob 

    • Marked as answer by Guile Kim Monday, January 7, 2013 1:24 AM
    Friday, January 4, 2013 3:52 PM
    Owner

All replies

  • Hi Guile,

    Your app does not have write access to its installed location. Instead store runtime data in your application data folders. See http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464917.aspx for more information.

    Your file copies are working because the app isn't installed: you are running it uninstalled from the project directory, which you do have access to. When it is filly deployed it will be installed in Program Files with limited access rights.

    --Rob 

    • Marked as answer by Guile Kim Monday, January 7, 2013 1:24 AM
    Friday, January 4, 2013 3:52 PM
    Owner
  • Note this is also true of Win32 desktop applications running on Windows Vista, Windows 7, Windows 8, etc. due to the effects of User Account Control. Do not assume you have write access to your 'install' location, only your 'application data' folder'.


    Friday, January 4, 2013 7:43 PM