locked
Metro binary READ\WRITE access to the file system

    Question

  • Where can I find documentation on file system access rights given to Metro binaries? I have the following specific questions:

    1. Does a Metro binary have the same file READ access as the equivalent logged in user in classic desktop? For e.g. can a Metro binary READ file contents from all locations that a Win32 binary (running in classic desktop) running in same user' account is able to READ?  

    2. What are the restrictions on file WRITE access to Metro binaries?

    Thursday, October 20, 2011 4:15 PM

Answers

  • There are desktop products containing Win32 system services. Typically UI of such products communicate with their services and display relevant information in UI. I am not seeing any conclusive documentation anywhere providing guidelines on how such apps would migrate to Metro? System service cannot be removed from product because it is there for a reason. So the simplest solution would be for the service to somehow provide data to the Metro app to display.

    This whole Metro paradigm maps better to UI apps that primarily interact with services on the web (e.g. webservice, xhr etc) or local services that MS defines. Or is Microsoft putting a stake in the ground and saying that products with local system services shall not have Metro presence?? 

     



    Friday, October 21, 2011 12:17 AM

All replies

  • File system access from metro-style apps is possible in 3 ways:

    • Access to AppData: Apps always have read access to their installed directory and read/write access to their own AppData. Both locations are specific to the app and are not shared with other apps. These locations should be used to store any app specific content.
    • Access through the file picker:  Apps can gain access to file system items by launching one of the picker objects. Users can explicitly navigate through the Picker and select items that provide read write access, for example selecting an item in the FileOpenPicker. E.g. You can invoke the FileOpenPicker if you want to enable the user to select a picture as their profile pic.
    • Access through capabilities:  Metro-style apps can declare read/write access to the user libraries through capabilities. Capabilities declared in the app manifest allow apps to access the user libraries on the machine or on the HomeGroup.  Users can control which folders the app has access to by adding/removing folders from the Library. Details about capabilities can be found here.  E.g. You would declare the Pictures Library capability if you want to build a gallery app that showcases the user’s pictures in Pictures Library.
    Thursday, October 20, 2011 6:25 PM
  • Thanks Jerry. Few questions on 'Access to AppData'

    1. Can Metro app installation chose the install location or Win8 installs the app in some arbitrary location?

    2. Can a Win32 service discover the installation location of a metro app and write files into it?

    Thursday, October 20, 2011 6:35 PM
    1. No.  The installation location is determined by Windows and cannot be changed.
    2. Generally, there is no need for desktop applications to take dependencies on Metro-app data locations.  Is there a specific scenario you are trying to accomodate?  If you could describe in more detail what you are trying to achieve I might be able to provide additional guidance.
    Thursday, October 20, 2011 11:42 PM
  • There are desktop products containing Win32 system services. Typically UI of such products communicate with their services and display relevant information in UI. I am not seeing any conclusive documentation anywhere providing guidelines on how such apps would migrate to Metro? System service cannot be removed from product because it is there for a reason. So the simplest solution would be for the service to somehow provide data to the Metro app to display.

    This whole Metro paradigm maps better to UI apps that primarily interact with services on the web (e.g. webservice, xhr etc) or local services that MS defines. Or is Microsoft putting a stake in the ground and saying that products with local system services shall not have Metro presence?? 

     



    Friday, October 21, 2011 12:17 AM