Use of WSA.Launcher.LaunchFile

Hello,

I’m trying to use the WSA.Launcher.LaunchFile (Unity - Scripting API: WSA.Launcher.LaunchFile) 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 :

    void Start () {
        Launcher.LaunchFile(UnityEngine.WSA.Folder.Local, @"\toto.txt", false);
    }

Thanks in advance.

Best regards.

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.

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

All of UnityEngine.WSA.Folders (exception Installation, Temprorary, Local and Roaming) map directly to these values: KnownFolders Class (Windows.Storage) - Windows UWP applications | Microsoft Learn

Perfect, thanks :slight_smile:

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