Set Unity app as default app

Hello!

Not sure if this is the right place for my question, found nothing on the subject with google.

I am planning on writing a small PDF viewer app using Unity (with some special funtions and possibly multiplatform). I can´t find any information on this specific thing though:

If I work for example in the Windows file explorer, I can select “open with” and select my Unity App (.exe). This should send a message with full path and filename to my app.

Now how do I make my app listen for this path and filename? Is this even possible in Unity?

Best regards
Henrik Karlsson

Hi @honkzor , you might try using C# to achieve that.
In the following link, you may find how to get the full path and filename.
Also, there is a way to invoke “Open With” using C# as well. You just need to check out at this link, and also this one, in which this is invoked from a Process.
Then you could get the result by using the output from the process like the following example.

Keep in mind that every OS has its own way to invoke Open With.

Let me know if you need any further help.

This may help Change default programs in Windows - Microsoft Support