I'm working on a MacOS application built in Unity3D. I'm using a native file browser plugin to open native MacOS file dialogs for selecting files. In order to generate PDFs, my app relies on using Chromium's Headless/command line functionality.
On Windows, I can easily get the path to the included Microsoft Edge as that's standard, but on Mac, unless I guess and check (which I already do), there isn't a way to guarantee a Mac user has a Chromium-based browser installed.
So I intend on allowing the user to set the path manually by selecting the .app file with a file dialog. But even when I specify .app to be a valid extension, they still don't appear selectable.
I assume this is some sort of MacOS-specific limitation or default permissions, though I can't find much info on this online.
Using C#/DotNet s there any way of allowing this behavior as needed?
For some more info: I'm just running the application using System.Diagnostics.Process.Start() with command line arguments. Based on my experiments searching for Google Chrome (though Edge or Opera are just as usable), the path I'm looking for is: /Applications/ {{APP NAME}}.app/Contents/MacOS/{{APP NAME}} Because Contents isn't accessible by most users, I figured I would just automatically go in and grab the binary with the correct name once I have the path to the .app file.
I know I could include some lightweight version of ChromeDriver with my app, but I'd rather keep everything as self-contained as possible, especially as so many people already have Chrome (or Opera, Edge, etc) installed. The challenge is that not everyone has it installed in the same place, hence my need to make it customizable.
Any ideas or help would be appreciated! Thanks!
I don't plan on publishing to the Mac App Store, and only distributing through my website. (Please no judgment there).
That’s fine. The reason I asked is that the Mac App Store requires that you enable the App Sandbox and the App Sandbox has a massive impact on your ability to find and run other code.
Interestingly, I only encountered this problem in the Unity Editor. Once I built the app into a standalone player, it did allow selection of .app files!
Weird. At this point I’m labelling this as a Unity-specific issue and I encourage you to escalate it via their support channel.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"