Class Upgrade
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Inheritance
Namespace: DotNetNuke.Services.Upgrade
Assembly: DotNetNuke.dll
Syntax
public class Upgrade : object
Properties
| Improve this Doc View SourceDefaultProvider
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string DefaultProvider { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
RunTime
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static TimeSpan RunTime { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Methods
| Improve this Doc View SourceActivateLicense()
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string ActivateLicense()
Returns
| Type | Description |
|---|---|
| System.String |
AddAdminPage(PortalInfo, String, String, String, String, Boolean)
AddAdminPage adds an Admin Tab Page.
Declaration
public static TabInfo AddAdminPage(PortalInfo portal, string tabName, string description, string tabIconFile, string tabIconFileLarge, bool isVisible)
Parameters
| Type | Name | Description |
|---|---|---|
| PortalInfo | portal | The Portal. |
| System.String | tabName | The Name to give this new Tab. |
| System.String | description | |
| System.String | tabIconFile | The Icon for this new Tab. |
| System.String | tabIconFileLarge | |
| System.Boolean | isVisible | A flag indicating whether the tab is visible. |
Returns
| Type | Description |
|---|---|
| TabInfo | A TabInfo instance or null. |
AddAdminPages(String, String, String, String, Boolean, Int32, String, String, Boolean)
AddAdminPages adds an Admin Page and an associated Module to all configured Portals.
Declaration
public static void AddAdminPages(string tabName, string description, string tabIconFile, string tabIconFileLarge, bool isVisible, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tabName | The Name to give this new Tab. |
| System.String | description | |
| System.String | tabIconFile | The Icon for this new Tab. |
| System.String | tabIconFileLarge | |
| System.Boolean | isVisible | A flag indicating whether the tab is visible. |
| System.Int32 | moduleDefId | The Module Definition Id for the module to be added to this tab. |
| System.String | moduleTitle | The Module's title. |
| System.String | moduleIconFile | The Module's icon. |
| System.Boolean | inheritPermissions | Modules Inherit the Pages View Permissions. |
AddHostPage(String, String, String, String, Boolean)
AddHostPage adds a Host Tab Page.
Declaration
public static TabInfo AddHostPage(string tabName, string description, string tabIconFile, string tabIconFileLarge, bool isVisible)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tabName | The Name to give this new Tab. |
| System.String | description | |
| System.String | tabIconFile | The Icon for this new Tab. |
| System.String | tabIconFileLarge | |
| System.Boolean | isVisible | A flag indicating whether the tab is visible. |
Returns
| Type | Description |
|---|---|
| TabInfo | A TabInfo instance or null. |
AddModuleControl(Int32, String, String, String, String, SecurityAccessLevel, Int32)
AddModuleControl adds a new Module Control to the system.
Declaration
public static void AddModuleControl(int moduleDefId, string controlKey, string controlTitle, string controlSrc, string iconFile, SecurityAccessLevel controlType, int viewOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | moduleDefId | The Module Definition Id. |
| System.String | controlKey | The key for this control in the Definition. |
| System.String | controlTitle | The title of this control. |
| System.String | controlSrc | The source of ths control. |
| System.String | iconFile | The icon file. |
| SecurityAccessLevel | controlType | The type of control. |
| System.Int32 | viewOrder | The vieworder for this module. |
AddModuleDefinition(String, String, String)
AddModuleDefinition adds a new Core Module Definition to the system.
Declaration
public static int AddModuleDefinition(string desktopModuleName, string description, string moduleDefinitionName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | desktopModuleName | The Friendly Name of the Module to Add. |
| System.String | description | Description of the Module. |
| System.String | moduleDefinitionName | The Module Definition Name. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The Module Definition Id of the new Module. |
Remarks
This overload assumes the module is an Admin module and not a Premium Module.
AddModuleToPage(TabInfo, Int32, String, String, Boolean, Boolean, String)
AddModuleToPage adds a module to a Page.
Declaration
public static int AddModuleToPage(TabInfo page, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions, bool displayTitle, string paneName)
Parameters
| Type | Name | Description |
|---|---|---|
| TabInfo | page | The Page to add the Module to. |
| System.Int32 | moduleDefId | The Module Definition Id for the module to be added to this tab. |
| System.String | moduleTitle | The Module's title. |
| System.String | moduleIconFile | The Module's icon. |
| System.Boolean | inheritPermissions | Inherit the Pages View Permissions. |
| System.Boolean | displayTitle | |
| System.String | paneName |
Returns
| Type | Description |
|---|---|
| System.Int32 | The ID of the module, or NullInteger to indicate failure. |
AddModuleToPage(TabInfo, Int32, String, String, Boolean)
AddModuleToPage adds a module to a Page.
Declaration
public static int AddModuleToPage(TabInfo page, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions)
Parameters
| Type | Name | Description |
|---|---|---|
| TabInfo | page | The Page to add the Module to. |
| System.Int32 | moduleDefId | The Module Definition Id for the module to be added to this tab. |
| System.String | moduleTitle | The Module's title. |
| System.String | moduleIconFile | The Module's icon. |
| System.Boolean | inheritPermissions | Inherit the Pages View Permissions. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The ID of the module, or NullInteger to indicate failure. |
AddModuleToPage(String, Int32, Int32, String, String, Boolean)
AddModuleToPage adds a module to a Page.
Declaration
public static int AddModuleToPage(string tabPath, int portalId, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tabPath | |
| System.Int32 | portalId | |
| System.Int32 | moduleDefId | The Module Definition Id for the module to be added to this tab. |
| System.String | moduleTitle | The Module's title. |
| System.String | moduleIconFile | The Module's icon. |
| System.Boolean | inheritPermissions | Inherit the Pages View Permissions. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The ID of the module, or NullInteger to indicate failure. |
AddModuleToPages(String, Int32, String, String, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static void AddModuleToPages(string tabPath, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tabPath | |
| System.Int32 | moduleDefId | |
| System.String | moduleTitle | |
| System.String | moduleIconFile | |
| System.Boolean | inheritPermissions |
AddPortal(XmlNode, Boolean, Int32, UserInfo)
AddPortal manages the Installation of a new DotNetNuke Portal.
Declaration
public static int AddPortal(XmlNode node, bool status, int indent, UserInfo superUser = null)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | |
| System.Boolean | status | |
| System.Int32 | indent | |
| UserInfo | superUser |
Returns
| Type | Description |
|---|---|
| System.Int32 | The ID of the new portal, or |
AddPortal(XmlNode, Boolean, Int32)
Obsolete, AddPortal manages the Installation of a new DotNetNuke Portal.
Declaration
public static int AddPortal(XmlNode node, bool status, int indent)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | |
| System.Boolean | status | |
| System.Int32 | indent |
Returns
| Type | Description |
|---|---|
| System.Int32 | The ID of the new portal, or |
DeleteFiles(String, Version, Boolean)
DeleteFiles - clean up deprecated files and folders.
Declaration
public static string DeleteFiles(string providerPath, Version version, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | Path to provider. |
| Version | version | The Version being Upgraded. |
| System.Boolean | writeFeedback | Display status in UI?. |
Returns
| Type | Description |
|---|---|
| System.String | Exceptions logged or |
DeleteInstallerFiles()
DeleteInstallerFiles - clean up install config and installwizard files. If installwizard is ran again this will be recreated via the dotnetnuke.install.config.resources file.
Declaration
public static void DeleteInstallerFiles()
Remarks
uses FileSystemUtils.DeleteFile as it checks for readonly attribute status and changes it if required, as well as verifying file exists.
ExecuteScript(String)
ExecuteScript executes a special script.
Declaration
public static void ExecuteScript(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | The script file to execute. |
ExecuteScripts(String)
ExecuteScripts manages the Execution of Scripts from the Install/Scripts folder. It is also triggered by InstallDNN and UpgradeDNN.
Declaration
public static void ExecuteScripts(string strProviderPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strProviderPath | The path to the Data Provider. |
GetInstallPackages()
Gets a list of installable extensions sorted to ensure dependencies are installed first.
Declaration
public static IDictionary<string, PackageInfo> GetInstallPackages()
Returns
| Type | Description |
|---|---|
| IDictionary<System.String, PackageInfo> | An |
GetInstallTemplate(XmlDocument)
GetInstallTemplate retrieves the Installation Template as specified in web.config.
Declaration
public static string GetInstallTemplate(XmlDocument xmlDoc)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlDoc | The Xml Document to load. |
Returns
| Type | Description |
|---|---|
| System.String | A string which contains the error message - if appropriate. |
GetInstallVersion(XmlDocument)
GetInstallVersion retrieves the Base Install Version as specified in the install template.
Declaration
public static Version GetInstallVersion(XmlDocument xmlDoc)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlDoc | The Install Template. |
Returns
| Type | Description |
|---|---|
| Version | The |
GetLogFile(String, Version)
GetLogFile gets the filename for the version's log file.
Declaration
public static string GetLogFile(string providerPath, Version version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | The path to the Data Provider. |
| Version | version | The Version. |
Returns
| Type | Description |
|---|---|
| System.String | The path to the log file. |
GetScriptFile(String, Version)
GetScriptFile gets the filename for the version.
Declaration
public static string GetScriptFile(string providerPath, Version version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | The path to the Data Provider. |
| Version | version | The Version. |
Returns
| Type | Description |
|---|---|
| System.String | The path to the script file. |
GetStringVersion(Version)
GetStringVersion gets the Version String (xx.xx.xx) from the Version.
Declaration
public static string GetStringVersion(Version version)
Parameters
| Type | Name | Description |
|---|---|---|
| Version | version | The Version. |
Returns
| Type | Description |
|---|---|
| System.String | The |
GetSuperUser(XmlDocument, Boolean)
GetSuperUser gets the superuser from the Install Template.
Declaration
public static UserInfo GetSuperUser(XmlDocument xmlTemplate, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlTemplate | The install Template. |
| System.Boolean | writeFeedback | a flag to determine whether to output feedback. |
Returns
| Type | Description |
|---|---|
| UserInfo | A UserInfo instance or null. |
GetUpgradeScripts(String, Version)
GetUpgradeScripts gets an ArrayList of the Scripts required to Upgrade to the current Assembly Version.
Declaration
public static ArrayList GetUpgradeScripts(string providerPath, Version databaseVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | The path to the Data Provider. |
| Version | databaseVersion | The current Database Version. |
Returns
| Type | Description |
|---|---|
| ArrayList | An |
InitialiseHostSettings(XmlDocument, Boolean)
InitialiseHostSettings gets the Host Settings from the Install Template.
Declaration
public static void InitialiseHostSettings(XmlDocument xmlTemplate, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlTemplate | The install Template. |
| System.Boolean | writeFeedback | a flag to determine whether to output feedback. |
InstallDatabase(Version, String, XmlDocument, Boolean)
InstallDatabase runs all the "scripts" identified in the Install Template to install the base version.
Declaration
public static string InstallDatabase(Version version, string providerPath, XmlDocument xmlDoc, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| Version | version | |
| System.String | providerPath | |
| XmlDocument | xmlDoc | The Xml Document to load. |
| System.Boolean | writeFeedback | A flag that determines whether to output feedback to the Response Stream. |
Returns
| Type | Description |
|---|---|
| System.String | A string which contains the error message - if appropriate. |
InstallDNN(String)
InstallDNN manages the Installation of a new DotNetNuke Application.
Declaration
public static void InstallDNN(string strProviderPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strProviderPath | The path to the Data Provider. |
InstallFiles(XmlDocument, Boolean)
InstallFiles installs any files listed in the Host Install Configuration file.
Declaration
public static void InstallFiles(XmlDocument xmlDoc, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlDoc | The Xml Document to load. |
| System.Boolean | writeFeedback | A flag that determines whether to output feedback to the Response Stream. |
InstallPackage(String, String, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static bool InstallPackage(string file, string packageType, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | |
| System.String | packageType | |
| System.Boolean | writeFeedback |
Returns
| Type | Description |
|---|---|
| System.Boolean |
InstallPackages(String, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static void InstallPackages(string packageType, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | packageType | |
| System.Boolean | writeFeedback |
IsLanguageEnabled(Int32, String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
protected static bool IsLanguageEnabled(int portalid, string code)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalid | |
| System.String | code |
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsNETFrameworkCurrent(String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static bool IsNETFrameworkCurrent(string version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | version |
Returns
| Type | Description |
|---|---|
| System.Boolean |
MakeModulePremium(String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static void MakeModulePremium(string moduleName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | moduleName |
RemoveAdminPages(String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static void RemoveAdminPages(string tabPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tabPath |
RemoveHostPage(String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static void RemoveHostPage(string pageName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pageName |
RemoveInvalidAntiForgeryCookie()
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static bool RemoveInvalidAntiForgeryCookie()
Returns
| Type | Description |
|---|---|
| System.Boolean |
RemoveModule(String, String, Int32, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static int RemoveModule(string desktopModuleName, string tabName, int parentId, bool removeTab)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | desktopModuleName | |
| System.String | tabName | |
| System.Int32 | parentId | |
| System.Boolean | removeTab |
Returns
| Type | Description |
|---|---|
| System.Int32 |
SetInstallTemplate(XmlDocument)
SetInstallTemplate saves the XmlDocument back to Installation Template specified in web.config.
Declaration
public static string SetInstallTemplate(XmlDocument xmlDoc)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlDocument | xmlDoc | The Xml Document to save. |
Returns
| Type | Description |
|---|---|
| System.String | A string which contains the error massage - if appropriate. |
StartTimer()
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static void StartTimer()
UpdateConfig(String, String, Version, String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpdateConfig(string providerPath, string configFile, Version version, string reason)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | |
| System.String | configFile | |
| Version | version | |
| System.String | reason |
Returns
| Type | Description |
|---|---|
| System.String |
UpdateConfig(String, Version, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpdateConfig(string providerPath, Version version, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | |
| Version | version | |
| System.Boolean | writeFeedback |
Returns
| Type | Description |
|---|---|
| System.String |
UpdateConfig(String, Version, String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpdateConfig(string configFile, Version version, string reason)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | configFile | |
| Version | version | |
| System.String | reason |
Returns
| Type | Description |
|---|---|
| System.String |
UpdateNewtonsoftVersion()
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static bool UpdateNewtonsoftVersion()
Returns
| Type | Description |
|---|---|
| System.Boolean |
UpgradeApplication()
UpgradeApplication - This overload is used for general application upgrade operations.
Declaration
public static void UpgradeApplication()
Remarks
Since it is not version specific and is invoked whenever the application is restarted, the operations must be re-executable.
UpgradeApplication(String, Version, Boolean)
UpgradeApplication - This overload is used for version specific application upgrade operations.
Declaration
public static string UpgradeApplication(string providerPath, Version version, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | |
| Version | version | |
| System.Boolean | writeFeedback |
Returns
| Type | Description |
|---|---|
| System.String | Exceptions logged or |
Remarks
This should be used for file system modifications or upgrade operations which should only happen once. Database references are not recommended because future versions of the application may result in code incompatibilities.
UpgradeDNN(String, Version)
UpgradeDNN manages the Upgrade of an existing DotNetNuke Application.
Declaration
public static void UpgradeDNN(string providerPath, Version dataBaseVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | providerPath | The path to the Data Provider. |
| Version | dataBaseVersion | The current Database Version. |
UpgradeIndicator(Version, Boolean, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpgradeIndicator(Version version, bool isLocal, bool isSecureConnection)
Parameters
| Type | Name | Description |
|---|---|---|
| Version | version | |
| System.Boolean | isLocal | |
| System.Boolean | isSecureConnection |
Returns
| Type | Description |
|---|---|
| System.String |
UpgradeIndicator(Version, String, String, String, Boolean, Boolean)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpgradeIndicator(Version version, string packageType, string packageName, string culture, bool isLocal, bool isSecureConnection)
Parameters
| Type | Name | Description |
|---|---|---|
| Version | version | |
| System.String | packageType | |
| System.String | packageName | |
| System.String | culture | |
| System.Boolean | isLocal | |
| System.Boolean | isSecureConnection |
Returns
| Type | Description |
|---|---|
| System.String |
UpgradeRedirect()
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpgradeRedirect()
Returns
| Type | Description |
|---|---|
| System.String |
UpgradeRedirect(Version, String, String, String)
The Upgrade class provides Shared/Static methods to Upgrade/Install a DotNetNuke Application.
Declaration
public static string UpgradeRedirect(Version version, string packageType, string packageName, string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| Version | version | |
| System.String | packageType | |
| System.String | packageName | |
| System.String | culture |
Returns
| Type | Description |
|---|---|
| System.String |
UpgradeVersion(String, Boolean, out Boolean)
UpgradeVersion upgrades a single version.
Declaration
public static string UpgradeVersion(string scriptFile, bool writeFeedback, out bool scriptExecuted)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | scriptFile | The upgrade script file. |
| System.Boolean | writeFeedback | Write status to Response Stream?. |
| System.Boolean | scriptExecuted | Identity whether the script file executed. |
Returns
| Type | Description |
|---|---|
| System.String | Exceptions logged or |
UpgradeVersion(String, Boolean)
UpgradeVersion upgrades a single version.
Declaration
public static string UpgradeVersion(string scriptFile, bool writeFeedback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | scriptFile | The upgrade script file. |
| System.Boolean | writeFeedback | Write status to Response Stream?. |
Returns
| Type | Description |
|---|---|
| System.String | Exceptions logged or |