Starting DotNetNuke 5 and above has an improved module installer. Modules now fall under the umbrella of "extensions". Extension is a unified system that includes module, skin, container, language pack, etc. As a result, the new installer is also better referred to as "package installer" because it can install more than just modules. In this article, we'll talk about the flow of installing, upgrading and uninstalling a module.
Like in previous DNN version, the installer expects a compressed zip file containing at least a single .dnn manifest file. The manifest itself has been overhauled to support the new features. All DNN modules are by convention versioned according to the triplet convention major.minor.revision.
Flow for New Install
1. Parse manifest.
2. Register assemblies in the Assembly component of the manifest.
3. Create DesktopModule folder with the "foldername" specified in manifest.
4. Run all scripts included in the Script component of the manifest marked as "Install" type up to and including the version being installed. Scripts should use "IF NOT EXISTS" statement to ensure not overwriting existing schema.
5. Copy all files included in the File component of the manifest.
6. Extract all files included in the Resource component of the manifest.
7. Delete all files included in the Cleanup component of the manifest up to and including the version being installed. Files specified in the manifest should include the "path" node and the value of the path should be relative the root of the DNN system.
8. Copy assemblies to bin. IIS restarts automatically.
9. DNN will run the upgrade process of all the versions specified in the EventMessage node of the manifest even if this is a new install by calling the implementation of IUpgradeable in your controller class. NOTE: Versions in the EventMessage are specified as comma delimited numbers. To view the upgrades, you need to configure enable on the DesktopModule_Upgrade setting under Admin > Event Viewer before running the install.
Flow for Upgrade
1. Parse manifest.
2. Register assemblies in the Assembly component of the manifest.
3. Create DesktopModule folder with the "foldername" specified in manifest.
4. Run all scripts included in the Script component of the manifest from the next immediate version above the running version up to and including the version being installed. Scripts should use "IF NOT EXISTS" statement to ensure not overwriting existing schema.
5. Copy all files included in the File component of the manifest.
6. Extract all files included in the Resource component of the manifest.
7. Delete all files included in the Cleanup component of the manifest from the next immediate version above the running version up to and including the version being installed. Files specified in the manifest should include the "path" node and the value of the path should be relative to the root of the DNN system.
8. Copy assemblies to bin. IIS restarts automatically.
9. DNN will run the upgrade process of all the versions specified in the EventMessage node of the manifest by calling the implementation of IUpgradeable in your controller class. NOTE: Versions in the EventMessage are specified as comma delimited numbers. To view the upgrades, you need to configure enable on the DesktopModule_Upgrade setting under Admin > Event Viewer before running the install.
Flow for Uninstall
1. Unregister module.
2. Unregister assemblies. If "Delete files" is selected, delete all assemblies.
3. Execute the uninstall SqlDataProvider file defined in the manifest during installation. If "Delete files" is selected, delete all SqlDataProvider files. NOTE: DNN will execute uninstall SqlDataProvider file regardless of version specified in the manifest.
4. If "Delete files" is selected, delete all files included in the File component of the manifest.
5. If "Delete files" is selected, delete all files included in the Resource component of the manifest.
6. If "Delete files" is selected, delete DesktopModule folder if no remaining files exist. NOTE: Any externally created files or files that created as part of normal usage are never deleted.