macos-installer-builder icon indicating copy to clipboard operation
macos-installer-builder copied to clipboard

Could I create a preinstall script?

Open kaduartur opened this issue 4 years ago • 3 comments

Hi @KosalaHerath, could you help me?

I use your script and I need to run a pre-install script.

Do you think it is possible to do this?

by the way, your script helped me a lot, thanks! 🚀

kaduartur avatar Sep 03 '20 19:09 kaduartur

Hi Arthur,

It's great to hear. Yes, you can add a preinstall script to the scripts directory and copy it to the package. You only need to create a preinstall shell script in the following directory.

scripts/preinstall

Since the existing building script only copy postinstall file to the product(https://github.com/KosalaHerath/macos-installer-builder/blob/master/macOS-x64/build-macos-x64.sh#L105) you may need to add a shell command to copy preinstall file in the build script. When the installer is running, it will automatically run this script before the installation. PRs are welcome.

More details can find here: https://matthew-brett.github.io/docosx/flat_packages.html

Hope you find the answer here. 😇

KosalaHerath avatar Sep 04 '20 07:09 KosalaHerath

Hi @KosalaHerath, thanks for the reply.

I will open a PR to add a preinstall example.

I work in an open-source project named Ritchie-CLI to automate repeated tasks, maybe you could create a "formula" for your script. What do you think about it?

Ritchie-cli docs

I'm very excited about it!

kaduartur avatar Sep 04 '20 13:09 kaduartur

Hi Artur,

It is an exciting framework, sure I will give a try. Thanks for your suggestions and contribution.

KosalaHerath avatar Sep 04 '20 15:09 KosalaHerath