packagesdev / packages

Integrated Packaging Environment for OS X
312 stars 44 forks source link

run objc/swift code during cli installation #129

Open soldatenkodmitru opened 1 year ago

soldatenkodmitru commented 1 year ago

I have the project with custom plugins writing on objective-c. When I run installation via command line “installer sudo -pkg # {package} -target /" my objc code don't perform. Is there a way to run objc-code during cli installation?

packagesdev commented 1 year ago

If this is an Installer plugin, it won't run in headless mode (i.e. via the installer(8) command line tool or a deployment solution such as ARD, Jamf, Intunes, Workspace One, etc.).

http://s.sudre.free.fr/Stuff/Installer/Installer_Plugins/InstallerPlugins-OnceUponATime.html

ferben commented 1 year ago

In your preinstall/postinstall scripts you can detect variable "COMMAND_LINE_INSTALL". If installer run from terminal (non-GUI installation) variable COMMAND_LINE_INSTALL=1, otherwise this variable is unset.