locked
Accessing the system files in Windows 8 Store

    Question

  • Is it possible to access system files in Windows 8 Store?

    I don't actually have any intent to write to system files; I just want to read things like the registry or say, certain parts of the file system. If the application were actually malicious I'm sure Microsoft's censors would catch it.

    Saturday, January 05, 2013 2:43 PM

Answers

  • By default, without any form of user consent, an app can access only its AppData areas (local, roaming, and temp--read/write), and its package location (read only). If it has declared capabilities for media libraries in the manifest (videos, pictures, music) it can also programmatically access those areas (read/write) without additional user consent. Working with the Documents folder and removable storage devices similarly have capabilities to declare in the manifest and also require registration of specific file types.

    Beyond that, access to anything else requires user consent, which happens through the File Picker API. If the user opens a file or folder on some part of the file system through the file picker, they are granting your app programmatic access to that file or folder. If you use the Access Cache (Windows.Storage.AccessCache), you can maintain those permissions between app sessions (saving the file path as a string is not sufficient for this).

    Do note that the file picker blocks access to sensitive areas of the file system, e.g. the Windows folder, Program Files, and so forth. So Windows Store apps have no access to those areas.

    Same thing for the registry: there is no means for a Windows Store app to access it (read or write). That can happen only from a desktop app.

    So those are the constraints: limited default access to the file system, fuller access through the pickers, and no registry access.

    Kraig
    Author, Programming Windows 8 Apps with HTML, CSS, and JavaScript, a free ebook from Microsoft Press


    Monday, January 07, 2013 5:20 PM
  • No, this isn't possible. Windows Store apps are isolated from the system so they cannot make changes the user doesn't expect. They can only read their own application data without the user's permission.

    --Rob

    Saturday, January 05, 2013 7:00 PM
    Owner

All replies

  • No, this isn't possible. Windows Store apps are isolated from the system so they cannot make changes the user doesn't expect. They can only read their own application data without the user's permission.

    --Rob

    Saturday, January 05, 2013 7:00 PM
    Owner
  • I found an application for file browsing which apparently allows the user to access the root file system.

    In this case, the user must interactively determine what parts of the system the user can access and approve such access.

    I would like to expand on this, because the function of the app I'd like to make involves reading parts of the file system and the registry and delivering that information in modified form to the user. It may also involve directly modifying the file system or editing the registry, but I don't actually need the write functionality outside what is normal and common for Windows 8 applications.

    Sunday, January 06, 2013 5:13 AM
  • By default, without any form of user consent, an app can access only its AppData areas (local, roaming, and temp--read/write), and its package location (read only). If it has declared capabilities for media libraries in the manifest (videos, pictures, music) it can also programmatically access those areas (read/write) without additional user consent. Working with the Documents folder and removable storage devices similarly have capabilities to declare in the manifest and also require registration of specific file types.

    Beyond that, access to anything else requires user consent, which happens through the File Picker API. If the user opens a file or folder on some part of the file system through the file picker, they are granting your app programmatic access to that file or folder. If you use the Access Cache (Windows.Storage.AccessCache), you can maintain those permissions between app sessions (saving the file path as a string is not sufficient for this).

    Do note that the file picker blocks access to sensitive areas of the file system, e.g. the Windows folder, Program Files, and so forth. So Windows Store apps have no access to those areas.

    Same thing for the registry: there is no means for a Windows Store app to access it (read or write). That can happen only from a desktop app.

    So those are the constraints: limited default access to the file system, fuller access through the pickers, and no registry access.

    Kraig
    Author, Programming Windows 8 Apps with HTML, CSS, and JavaScript, a free ebook from Microsoft Press


    Monday, January 07, 2013 5:20 PM