Platypus Installer Tutorial
This short tutorial will demonstrate the process of creating a GUI installer using a shell script and Platypus.
Step 1: Set Output Type
Once you have defined the name of your installer in the "App Name" field, you'll probably want to set Output as "Progress Bar" to indicate to the end user that some activity is taking place. Another option is "Text Window", in which case you can set your script to print out status messages into a text window while it is running. The install may take some time, depending on what you're installing.
Step 2: Set Installer Icon
Since you're making an installer, you may want to set the icon of the application to "Platypus Installer", or alternately, set your own custom icon by choosing "Select Custom Icon" from the "Advanced" menu.
Step 3: Set Advanced Options / Admin Privileges
If your installer needs to install files in protected locations on the file system (i.e. in places where your end user will typically not have write-privileges), you'll need to click "Show advanced options" and check the "Requires Adminstrator privileges" checkbox. This will make the app execute your script with administrator privileges after prompting the user for the administrator password.
Step 4: Select the files to be installed
We now want to define the files that our installer will actually install. We add files to the file list under "Advanced Options" by pressing the "+" button to the right until we have specified all the files we want.
These files will be copied into the Resources folder of the application we're about to create.
Step 5: Create the script
Now it's time to create the script that will actually do the installing. As can be seen in the image above, I've added two files: MyApp.app and MyFramework.framework. To install these two, I would use the following script:
echo "Installing MyApp.app in /Applications"
cp -R "$1/Contents/Resources/MyApp.app" "/Applications/"
echo "Installing MyFramework.framework in /Library/Frameworks"
cp -R "$1/Contents/Resources/MyFramework.framework" "/Library/Frameworks/"
The $1 variable contains the path to the application bundle itself, i.e. the application created by Platypus.
echo messages are optional, but may be helpful if you've set your output type to "Text Window": then your user will see these messages.
You may want to modify permissions using
chmod or do extra things like open the application (a simple "
With a script such as this and the above-mentioned settings we are ready to go -- press the Create button and you'll have a fully-functioning installer.