Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

[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,783
    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,783
    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,756
    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,756
    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.