Skip to content

Scriptless installs

atuttle edited this page Jul 7, 2012 · 1 revision

It is very possible that installing your project is simple enough that you don't need to create a custom script for it. We've tried to include an installer that will cover most simple cases, so you can simply re-use it, and add some config elements to the JSON index.

How to use Scriptless Installs

Scriptless Installs is actually a little bit of a misnomer. There is a script, but it's maintained by us, not you, and intended to be reusable by many projects.

Like all projects, a scriptless install still counts as a "version" of your project. Add a struct to the versions array of your project, like so:

{
	"name": "Version 1.0.3",
	"desc": "The most recent stable release of MyProject",
	"install": "https://raw.github.com/CFCommunity/ramen/master/index/standard_installer.cfm",
	"require": [
		{
			"name": "location",
			"label": "Install Location:",
			"type": "folder",
			"default": "{webroot}/MyProject"
		},
		{
			"name": "zipfile",
			"type": "hidden",
			"value": "https://github.com/downloads/atuttle/Taffy/taffy-v1.1.zip"
		},
		{
			"name": "escapeFolder",
			"type": "hidden",
			"value": "taffy"
		}
	]
}

This example illustrates several important points:

  1. The URL for the install script for all scriptless installs is: https://raw.github.com/CFCommunity/ramen/master/index/standard_installer.cfm.
  2. You can collect as many inputs from the user as you need to be passed to the installer for custom scripts; but the standard script only supports these:
  • location - (required) This is the folder into which your project will be installed.
    • Note: The {webroot} token will be replaced with expandPath('/') at runtime. You can build on it, as well. This is a valid default location: {webroot}/myproject. Currently, this is the only supported token. If you would find another token useful, submit an enhancement request or a pull request. :)
  • zipfile - (required) The URL of the zip file that should be downloaded, containing your project. (Note that it is type "hidden" - this places a hidden form field in the form.)
  • escapeFolder - If you want to only install a subset of what's in the zip, set the relative path (inside the zip) to the folder containing the files and folders to be installed. Note that this can be "deeply" nested. You can provide the value "taffy/core" and the {zipfile}/taffy/core/{files} will be installed, and everything else will be thrown away.
  • createFolder - (not pictured) Creates a new folder inside the user's chosen install location, and expands your zip inside of this folder.

If a config based on the one above can successfully install your project, then there is no need to include an install script.

Clone this wiki locally