Skip to content

Instantly share code, notes, and snippets.

@gildas
Last active October 11, 2022 06:24
Show Gist options
  • Save gildas/cc50cfc9b330cc4d0c07 to your computer and use it in GitHub Desktop.
Save gildas/cc50cfc9b330cc4d0c07 to your computer and use it in GitHub Desktop.
Fix packer error: couldn't find Parallels Tools for ... flavor after upgrading Parallels
# After upgrading Parallels Desktop, often, this command (used by the packer parallels driver):
# mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console
# will return not only one path, but a list of the old one(s) and the one:
# /opt/homebrew-cask/Caskroom/parallels-desktop/11.0.2-31348/Parallels Desktop.app
# /opt/homebrew-cask/Caskroom/parallels-desktop/11.1.0-32202/Parallels Desktop.app
#
# Maybe one day the packer team will fix their code and use only the highest version in that list,
# Until then we have to fix the list by ourselves:
mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console
# if you get a list of more than one entry, remove the older versions:
sudo rm -rf xxx
# Where xxx is an old version
# then you might have to fix the soft links in /usr/local/bin, if so:
for f in $(\ls -1 prl*); do
rm -f $f
ln -s "$(mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console)/Contents/MacOS/parallels_wrapper" $f
done
# When all done, mdfind should return only one line and packer will be happy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment