Search code examples
macospackagemaker

How to set up PackageMaker to create an icon on desktop after installation?


I have a requirement to create desktop icon after installation, and I can't find out how. I am using package maker to create a Mac install package (.pkg) I am aware that it is not the best practice to create shortcuts on desktop, but this an important requirement.


Solution

  • This functionality isn't built into PackageMaker and usually isn't seen with any Mac apps. That doesn't mean you can do this manually by writing a bash script that will run on completion of the installation and copy a file to the desktop. Just include a component and install it to \tmp then in the Postinstall script for that package mv the file to the $USER's desktop.

    ex. mv /tmp/icon.sh /Users/$USER/Desktop/icon.sh