KosalaHerath / macos-installer-builder

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

[Question] how to change application /Library/${product_name}/${version} to other directory? #11

Closed MichelleJin12 closed 3 years ago

MichelleJin12 commented 3 years ago

Hello, Thank you for inventing this cool open source.

However, I have a difficulty to changing application directory when .pkg installed.

I actually don't know much about shell programming, so can you let me know how to do this?

Thank you so much.

KosalaHerath commented 3 years ago

It's great to hear that this has helped you.

You can copy your application files into any directory path from the root (/).

You need to create the directory path in "darwinpkg" directory and copy your application files onto that before creating the installer as given in here.

As an example, I can create a directory path in "darwinpkg" as following:

/Library/${PRODUCT}/${VERSION}

Therefore, the installer will copy files as the same path starting from the root (/).

On the other hand, if you want to copy files to

"/Users/name/Documents/${PRODUCT}/${VERSION}"

you have to change these lines according to that replacing

"/Library/${PRODUCT}/${VERSION}"

with

"/Users/name/Documents/${PRODUCT}/${VERSION}"

This article will help you with more details.

Cheers!

KosalaHerath commented 3 years ago

Closing since the answer is provided.