macOS 平面文件 pkg 安装程序可以抛出错误对话框吗?

Can macOS flat file pkg installer throw error dialog?

如果系统上存在特定文件,我想抛出错误对话框(并使安装失败)。可能吗? pkg = flat file pkg

可以通过各种方式自定义安装程序以获得通常需要的任何功能。通常在您的场景中,可以使用 Pre-Installation 脚本或 Package Installer Plugin。这些选项通常会在安装程序包的 distribution.dist 中定义,它基本上充当它将遵循的模式。

请参阅手册页中的 productbuild

--scripts scripts-path - The contents of scripts-path is added to the product archive for use by system.run() commands commands in the distribution. This is valid only for product archives targeted to the OS X Installer application.

--plugins plugins-path - The contents of plugins-path is added to the product archive for use by the OS X Installer application's plugin mechanism. It will normally contain a InstallerSections.plist file, and one or more plugin bundles.

About Distribution Definition Files & productbuild