This short tutorial will demonstrate the process of creating a GUI installer using a shell script and Platypus.
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.
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.
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.
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.
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:
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.