This article is cross-posted from my personal blog.
In DotNetNuke v 4.6 a new installer system was introduced to handle the new Authentication Systems. In DotNetNuke 5.0 we have extended the use of the Installer to all extensions, including Modules, Language Packs and Skins.
In previous blogs in this series I introduced the new Extension Installer Manifest, and the 3 components that most developers would be fairly familiar with – Module, Assembly, File, as they are similar to the legacy module manifest, and I began to detail the individual component manifests by describing the Cleanup Component and the Assembly Component and File Component.
In this article I will dive deeper into the Script Component (see Listing 1).
Listing 1 - The Script Component manifest fragment from the BroadcastPollingCachingProvider
1: <component type="Script">
4: <script type="Install">
9: <script type="UnInstall">
The Script component is another Installer that inherits from the base File Component. The <basePath> element identifies the root location for the Script. It uses the <scripts> and <script> elements in place of the base class <files> and <file> element.
Note that there a few enhancements (compared with the legacy Module Installer) in how scripts are handled.
- Each script has a “type” attribute, which identifies whether the Script should be used in Install/Upgrade mode or is used 'in “UnInstall” mode
- Each script has a required version element which identifies which version the script corresponds to. This means that you no longer have to use the convention of naming the script with the version “xx.xx.xx.SqlDataProvider”. ou can of course still use the legacy naming convention, but you are not required to.
- The installer does support the “Install.SqlDataProvider” special script which is run first when installing an Extension.