Skip to content

CPack/productbuild: remove auth attribute

David Wosk requested to merge davidwosk1/cmake:cpack-pkg-auth-attr into master

This addresses #23030 (closed).

Summary

According to the documentation for the Distribution.xml file, the auth attribute in the pkg-ref element is deprecated. Instead, the domains element is the preferred way to determine the required authorization level needed for the install. Removing auth="Admin" allows package developers to create installers that do not require root privileges when installing to the user's home directory.

Testing

Prior to this change:

  1. Create custom Cpack.distribution.dist.in
  2. Specify <domains enable_currentUserHome="true" enable_localSystem="false"/>
  3. Build and run the pkg
  4. Observe the pkg requires root privileges to install to user's home directory

After this change:

  1. Repeat (1) through (3) above
  2. Observe the pkg does not require root privileges to install to user's home directory

Notes

In the case that the domains element is not specified, the documentation states the following:

If this element is not present, enable_anywhere is true, enable_currentUserHome is false, and enable_localSystem is true.

So any project that currently uses the default CPack.distribution.dist.in will still require root privileges.

Edited by Brad King

Merge request reports