Search Unity

[WSA] How to open Application.persistentDataPath?

Discussion in 'Windows' started by HonorableDaniel, Apr 18, 2017.

  1. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,814
    I need my users access to the persistentDataPath in Explorer, Application.OpenURL(Application.persistentDataPath); does not work and results in a failure. Anyone know how this can be done?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,248
    What kind of failure do you get?
     
  3. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,814
    I apologize, I should have included the log initially. It's not very informative, but here it is:
    OpenURL failed with url C:/Users/danie/AppData/Local/Packages/ShotPro_ksmqfnr5wwym6/LocalState
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,248
    What if you use proper URI there? Try prepending the path with file:///
     
  5. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,814
    No luck, I tried file:/// and file:// but neither one worked. The error message seems quite unhelpful. Any other ideas?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,436
    Perhaps try using Windows.System.Launcher.LaunchFolderAsync function instead?
     
  7. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,814
    Assets\Plugins\ShotPro\WSA.cs(80,35): error CS0117: 'Launcher' does not contain a definition for 'LaunchFolderAsync'

    I am targeting Windows 8.1.
     
  8. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,814
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,436
    It could be that the API was added on Windows 10 - Microsoft docs aren't very clear on that.

    What would you expect to happen on Windows Phone or HoloLens or Xbox? They don't really have the concept of Windows Explorer.
     
  10. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,814
    Oh, I didn't think of that. Makes sense though.