KosalaHerath / macos-installer-builder

Generate macOS installers for your applications and products from one command
Apache License 2.0
319 stars 92 forks source link

Could I create a preinstall script? #6

Open kaduartur opened 4 years ago

kaduartur commented 4 years ago

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! 🚀

KosalaHerath commented 4 years ago

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. 😇

kaduartur commented 4 years ago

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!

KosalaHerath commented 4 years ago

Hi Artur,

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