macos-installer-builder
macos-installer-builder copied to clipboard
Could I create a preinstall script?
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! 🚀
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. 😇
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?
I'm very excited about it!
Hi Artur,
It is an exciting framework, sure I will give a try. Thanks for your suggestions and contribution.