packages icon indicating copy to clipboard operation
packages copied to clipboard

installer plugins for non gui silent installation

Open iradization opened this issue 5 years ago • 3 comments

Hi, This question relates to the installer plugins that can be added to installer pkg file using this Packages. I wonder is Packages has any exposed configuration that enable the user to make the plugins run on non-gui mode.

In details, I'd like to have an installer that can run either from command line installer -pkg ~/myInstaller.pkg -target / Or in gui mode using open ~/myInstaller.pkg

Sadly, each new installer pane plugin main class derives from InstallerPane by default, so I guess they designed not to run on non-gui mode... #import <InstallerPlugins/InstallerPlugins.h>

@interface MyInstallerPane : InstallerPane

But perhaps there's a way to write non-GUI based installer plugins that can also run in command-line mode by inheriting from different class ?

And if this is not possible, so perhaps there's a way to get any indication on the current installation mode (gui/no gui) from the post/preinstall scripts, in order to avoid running the same logic twice ?

iradization avatar Sep 15 '20 06:09 iradization

you should be able to test for the presence of COMMAND_LINE_INSTALL in the ENV to know if you're being run via installer

rudyrichter avatar Oct 08 '20 13:10 rudyrichter

you should be able to test for the presence of COMMAND_LINE_INSTALL in the ENV to know if you're being run via installer

Thank you for suggestion. I'll try it in near future.

ferben avatar Nov 24 '20 11:11 ferben

Installer Plugins are not loaded when the installation process is run in headless mode (command line, deployment solutions).

As mentioned, you can check the COMMAND_LINE_INSTALL env and act accordingly.

I would not recommend popping up windows during a headless install.

packagesdev avatar Dec 10 '20 21:12 packagesdev