Can you use the PackageMaker command to create an installer from a list of files?

I want (periodically and automatically) to create an installer from different files and folders that are in many places. But I cannot figure out how to provide the packagemaker command with all the paths of the elements that I want to install.

This is for internal development purposes, not for distributing customers. I want the files to be configured; it’s not really an option to use the GUI to add all paths, because they will change frequently.

The best I could do was use the flag --watchand touchall the stuff I wanted to include in the package. This is very dirty and includes other files that can be accessed at the same time. There is no general outline of what I want to include, so I cannot just --filteruse the rest.

Ideally, I would just give him a file full of paths, and he would build the package. If this is not an option, I would not mind generating XML or putting them on the command line or something else will work. I probably have ~ 30 files that I want in the installer, but this number is likely to grow.

Is there a better way to do this? Am I missing a point?

edit . It is clear that I can copy all the files that I want into a package into a directory, and then use the flag --root. Is this the best way to do this?

edit 2 : Is there a way to do this with symbolic links, so I don't need to copy the files up to?

+3
source share
1 answer

(I do not mark this answer as accepted, because I really would like to create an installer from files in different places without copying them to an intermediate directory.)

As requested by Petert, here's how you create an installer from files in a directory. Please note that this is not exactly what I wanted, as it adds all the files to the directory. (And I just wanted to include some specific files.)

## create the fake root directory (which is also the name of the .pkg installer created)
## paths below this will be interpreted as absolute when the installer runs
mkdir -p MyInstaller

## create some fake stuff to install
install_to="MyInstaller/$HOME/installed_dir/"
mkdir -p "$install_to"
echo 'it worked!' > "$install_to/test.txt"

## actually create the installer
/Developer/usr/bin/packagemaker -i com.mycompany.myInstallerName --root MyInstaller

, -i ( plist.)

+1

Source: https://habr.com/ru/post/1740537/


All Articles