Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

[WSA] How to open Application.persistentDataPath?

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

  1. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    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:
    3,604
    What kind of failure do you get?
     
  3. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    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:
    3,604
    What if you use proper URI there? Try prepending the path with file:///
     
  5. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    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:
    10,434
    Perhaps try using Windows.System.Launcher.LaunchFolderAsync function instead?
     
  7. User340

    User340

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

    I am targeting Windows 8.1.
     
  8. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,434
    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. User340

    User340

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