Skip to main content
deleted 4 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Handling files with spaces and special characters

While the for f in *.xyz syntax looks 'clean' and neat, it is considered bad practice in bash because it is likely to fail on file names with spaces, quotes and other special chars. A more foolproof approach is to use find, e.g.

sudo -i

find . -iname "*.pkg" -maxdepth 1 -exec installer -verbose -pkg {} -target / \;

Note:-maxdepth 1 forces find to only search for files in the current folder and avoid traversing the nested subfolders.

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Handling files with spaces and special characters

While the for f in *.xyz syntax looks 'clean' and neat, it is considered bad practice in bash because it is likely to fail on file names with spaces, quotes and other special chars. A more foolproof approach is to use find, e.g.

sudo -i

find . -iname "*.pkg" -maxdepth 1 -exec installer -verbose -pkg {} -target / \;

Note:-maxdepth 1 forces find to only search for files in the current folder and avoid traversing the nested subfolders.

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Handling files with spaces and special characters

While the for f in *.xyz syntax looks 'clean' and neat, it is considered bad practice in bash because it is likely to fail on file names with spaces, quotes and other special chars. A more foolproof approach is to use find, e.g.

sudo -i

find . -iname "*.pkg" -maxdepth 1 -exec installer -verbose -pkg {} -target / \;

Note:-maxdepth 1 forces find to only search for files in the current folder and avoid traversing nested subfolders.

added 397 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Handling files with spaces and special characters

While the for f in *.xyz syntax looks 'clean' and neat, it is considered bad practice in bash because it is likely to fail on file names with spaces, quotes and other special chars. A more foolproof approach is to use find, e.g.

sudo -i

find . -iname "*.pkg" -maxdepth 1 -exec installer -verbose -pkg {} -target / \;

Note:-maxdepth 1 forces find to only search for files in the current folder and avoid traversing the nested subfolders.

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Handling files with spaces and special characters

While the for f in *.xyz syntax looks 'clean' and neat, it is considered bad practice in bash because it is likely to fail on file names with spaces, quotes and other special chars. A more foolproof approach is to use find, e.g.

sudo -i

find . -iname "*.pkg" -maxdepth 1 -exec installer -verbose -pkg {} -target / \;

Note:-maxdepth 1 forces find to only search for files in the current folder and avoid traversing the nested subfolders.

added 53 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too.

Install all .pkg files from the current folder to /Applications (or whatever target folder is configured in the package):

for f in *.pkg; do
    sudo installer -verbose -pkg "$f" -target /
done

As an alternative you can install the packages to your home folder with -target ~. They will end up in /Users/<your_account>/Applications unless a specific path is predefined in the installer.

If you want to see which specific folders a pkg installer writes to and which post-install scripts will be run then check out SuspiciousPackage (freeware, can be installed with brew install --cask suspicious-package), and use quick preview from Finder when a .pkg file is selected. Pressing spacebar in Finder with the selected file should work too. A similar shareware (nagware) app — Pacifist, can be used for inspecting and unpacking dmg/pkg and other container formats.

added 53 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
Loading
added 64 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
deleted 5 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
added 447 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
deleted 95 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
added 26 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
added 120 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
added 37 characters in body
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading
Source Link
ccpizza
  • 3.3k
  • 3
  • 38
  • 43
Loading