macOS Catalina: trying to install content to the system volume
Asked Answered
P

1

7

I have apps that I distribute as .pkg files created using pkgbuild and productbuild. With macOS Catalina, this doesn't work any more. The installer complains that I'm trying to install content to the system volume.

I posted three weeks ago thinking the error had to do with bundling a Java runtime. It turns out it has nothing to do with Java.

To test it I have the smallest possible project called Hello with a main window and a button to click. In XCode, I do Product -> Archive, then Distribute App, and Copy App. This creates a directory Hello 2019-12-18 15-01-07 with contents Hello.app. The app works fine. I then pkgbuild --root *7 Hello.pkg which creates Hello.pkg.

When I double-click Hello.pkg in the finder the installer presents me with screens for Introduction, Destination Select (only one option is offered), and Installation type ("Standard Install on Macintosh HD"), then asks me for my password. It then says, "This package is incompatible with this version of macOS. The package is trying to install content to the system volume. Contact the software manufacturer for assistance."

It makes no difference if I codesign and notarize. Productbuild only adds one more layer to the failing process.

What am I missing?

Persinger answered 18/12, 2019 at 20:58 Comment(2)
The system partition is now read-only, unless you disable SIP. You might take a look at creating a synthetic symbolic link - see man synthetic.conf.Jehiah
Yes, I suppose I could set something up to install the app on my own computer, but the objective is to create an installer than any user can click on. Before Catalina that was accomplished with pkgbuild and productbuild. Is there another set of tools I should use instead?Persinger
S
10

We could fix the issue by using the option

--install-location

of the pkgbuild command.

If the

--install-location

option is not used, pkgbuild uses / as the default install location in many cases.

In macOS Catalina, only certain folders are writable. Refer this link for more details.

In our case, the package installation succeeded only when we specified one of the writable folders such as

/usr/local
/opt
/Applications

as the default install location.

Springe answered 7/1, 2020 at 5:19 Comment(1)
Could able to install the package in root and Applications folder. Is there any way to install our package in system volume(Documents folder) without disable SIP?Asafetida

© 2022 - 2024 — McMap. All rights reserved.