Search Unity

Use of WSA.Launcher.LaunchFile

Discussion in 'Windows' started by Blue007422, Apr 3, 2018.

  1. Blue007422

    Blue007422

    Joined:
    Mar 2, 2017
    Posts:
    7
    Hello,

    I'm trying to use the WSA.Launcher.LaunchFile (https://docs.unity3d.com/ScriptReference/WSA.Launcher.LaunchFile.html) method but i'm having some trouble.
    I don't know what to put in the first argument, i don't know what the folder refers to, I've assumed that Local was "C:\Users\ME\AppData\Local\Packages\TestLaunchFile_abdcdefghil\LocalState" but whenever I try with this parameter then try to load the file test.txt in "C:\Users\ME\AppData\Local\Packages\TestLaunchFile_abdcdefghil\LocalState\test.txt"


    It always say to me "Failed to open '\test.txt' Exceptoin: 'The parameter is incorrect'


    Here is my code :

    Code (CSharp):
    1.     void Start () {
    2.         Launcher.LaunchFile(UnityEngine.WSA.Folder.Local, @"\toto.txt", false);
    3.     }
    Thanks in advance.

    Best regards.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Your assumption of "Local" folder was correct. It is what "ApplicationData.Current.LocalFolder" returns.

    You don't need a backslash in the relative file name argument. That is likely causing the issue.
     
  3. Blue007422

    Blue007422

    Joined:
    Mar 2, 2017
    Posts:
    7
    It's working, thank you very much.

    Last question, where can I find information about UnityEngine.WSA.Folder, I mean if I want to know what UnityEngine.WSA.Folder.HomeGroup refers to, where can I find the information ?

    Best regards

    Valentin
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  5. Blue007422

    Blue007422

    Joined:
    Mar 2, 2017
    Posts:
    7
    Perfect, thanks :)
     
  6. unity_DE695DAE84904F1A2BB7

    unity_DE695DAE84904F1A2BB7

    Joined:
    Mar 11, 2024
    Posts:
    1
    Hi, does anyone know how I can know by code when the edge has been activated using this program line or a whay to know when the process has finished, if it has had any error...? I want to activate a progress indicator while the edge is opening with the file and shut it dawn when it has finished.
    Thanks