What is package actions?
Package actions are a simple way to perform common tasks while installing packages / nitros. It is XML based and could be compared to f.ex. nant tasks. Actions perform small configuration related tasks, which could f.ex. be allowing a document type on another type, moving a document to another location or adding a string to an existing template.
Currently we have 10 actions available. If you need to perform more advanced installation routines, you will have to build a custom installer (.ascx based) or write your own package action using the IPackageAction Interface, which will then automatically be picked up by umbraco.
Adding actions to a package script
With the build-in packager, it is possible to add the actions you need directly from the UI. Just add <Action> nodes to the textare.
Alternatively the actions can be manually added to the package manifest by adding a <Actions> node containing the package actions xml.
Standard fields on all actions
· Undo, optional, is true by default.
· Alias, mandatory, The alias of the package action to be executed
· Runat, mandatory, can either be install or uninstall
Standard elements on all actions
All actions are a <Action> node element (notice the uppercase A)
Installing, Un-installing and Undo
In the first version of the package actions, about 10 actions were included, the high number of actions was caused by the fact that every action needed a corresponding uninstall action. So a “Insert string into template” action would also need a “Remove string from template” action to be un-installable.
This led to a lot of confusion and also opened up the possibility that the actions could be used for evil, (like removing the string “<umbraco:macro” from all templates, would cause quite a bit of havoc.
So in this revised version, an undo attribute has been put on all actions. An action will always contain an undo action which is turned on by default, but can be turned off.
At the same time, all actions that was actually only there to perform uninstall actions has been removed. Depending on community feedback, some of these might be included again.