0

We've got a macOS Avalonia problem when trying to package multiple builds for different cpu architectures in the same macOS .app bundle.

We are attempting to place the entire x64 and arm64 build folders inside the MacOS folder in the bundle and then use a script as a stand-in for the actual executable to detect the architecture and launch the actual, cpu-specific executable in the appropriate subfolder.

When launched directly from the terminal -- /path/to/Switcheroo/Publish/Switcheroo.app/Contents/MacOS/Switcheroo -- it runs fine.

It displays 2 things: the architecture and a message from a file on your desktop called switcheroo-message.txt.

Same thing for skipping the script entirely...

/path/to/Switcheroo/Publish/Switcheroo.app/Contents/MacOS/arm64/Switcheroo /path/to/Switcheroo/Publish/Switcheroo.app/Contents/MacOS/x64/Switcheroo

However, when double-clicked in the finder, an exception is thrown when the app tries to read that file.

I catch the exception and show only its name in the app window, but this is the full message:

"System.UnauthorizedAccessException: Access to the path '/Users/myuser/Desktop/switcheroo-message.txt' is denied"

Here is the test project. Hopefully someone in here has run into this before:

https://github.com/bamwu/Switcheroo

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.