Home > Mobile >  How to prevent the "XYZ would like to access files in your Downloads folder" message when
How to prevent the "XYZ would like to access files in your Downloads folder" message when

Time:11-13

I have an installer app that gets distributed inside of a notarized disk image. The app is a simple program that performs a few checks on the system and then launches the macOS installer to install a pkg that is contained with the app's bundle.

However, even though this app is inside a mounted disk image, and even though the file it's trying to open is inside its own signed and notarized bundle, it still triggers the "App would like to access files in your Downloads folder" if the dmg is located in the user's Downloads folder, which it almost always will be.

Is there any way to get this app to launch the installer without triggering this message? The entire point of the app is to try and make the installation process as smooth and seamless as possible. The explicit goal is that opening it will go directly into the mac installer with no warning messages, interruptions, or any other sort of dialog box that risks confusing or alarming the user.

Note: just distributing the pkg on its own is not an option, because the purpose of this app is to work around a bug in macOS's installer on Apple Silicon macs. The pkg is Intel only, and if I add a script to it that executes when the pkg opens, then it will confusingly display a warning message to the user twice, once when Installer.app opens as an arm64 process, and then again when it relaunches as an x86_64 process.

CodePudding user response:

This is an annoyingly roundabout workaround, but I managed to do it using launchd.

The gist of the method is to create a plist file in the user's temporary folder specifying a launchd job that starts on demand and just calls /usr/bin/open to open the pkg file inside the application bundle, and then call launchctl to load it. Once the installer is open, remove the launchd job.

  • Related