This short guide describes the process of creating new packages for DotNetPanel Web Applications Installer.
The default installation of DotNetPanel doesn't include application packages in order to reduce the size of the installation. However, the most popular application packs such as DotNetNuke, CommunityServer, StarterKits are available as a separate downloads from DotNetPanel web site.
Applications packs should be uploaded manually by the administrator to "[portal_install_folder]\DesktopModules\DotNetPanel\WebApplications" folder.
The structure of WebApplications folder is the following:
\WebApplications
\App1
Application.xml
Install.xml
Uninstall.xml
app_logo.gif
sql_script1.sql
sql_script2.sql
sql_scriptN.sql
app_files.zip
custom_settings.ascx
\App2
Application.xml
Install.xml
Uninstall.xml
app_logo.gif
sql_script1.sql
sql_script2.sql
sql_scriptN.sql
app_files.zip
custom_settings.ascx
...
\AppN
Each application is placed in a separate folder. The name of the application foler can be various just to differ one application from another.
The process of creating your own custom application packs includes the following steps:
1. Create application definiton file application.xml.
The basic structure of this file is:
<?xml version="1.0" encoding="utf-8" ?>
<application
id="DotNetNuke"
folder="DotNetNuke"
codebase="DotNetNuke.zip"
settingsControl="DotNetNuke.ascx"
databaseServer="MsSQL">
<name>DotNetNuke 3.1.1</name>
<category>Content Management Systems</category>
<shortDescription><b>Fully supports multiple installations into the single database!</b> DotNetNuke is a content management system ideal for creating and deploying projects such as commercial web sites, corporate intranets and extranets, and
online publishing portals.</shortDescription>
<fullDescription>DotNetNuke is a content management system ideal for creating and deploying
projects such as commercial web sites, corporate intranets and extranets, and
online publishing portals.<br/>
DotNetNuke is designed to make it easy for users to manage all aspects of their projects. Site wizards, help icons, and a well-researched user interface allow universal ease-of-operation.
</fullDescription>
<logo>dotnetnukelogo.gif</logo>
<version>3.1.1</version>
<size>10</size> <!-- Mb -->
<homeSite>http://www.dotnetnuke.com</homeSite>
<supportSite>http://forums.asp.net/90/ShowForum.aspx</supportSite>
<docSite>http://www.dotnetnuke.com/Default.aspx?tabid=787</docSite>
<manufacturer>Shaun Walker and community</manufacturer>
<license>BSD</license>
</application>
Elements/Attributes explanation:
Application "id" attribute should be unique across all applications.
"folder" attribute specifies the folder where application pack files reside.
"codebase" attribute is the name of the ZIP archive containing all application files that should be deployed to the target web site.
"settingsControl" attribute is the optional name of the pack-specific ASP.NET user control allowing to specify custom installation parameters.
"databaseServer" attribute is the name of SQL engine that will be used. Possible values are "MsSQL" and "MySQL".
All the rest of "application" elements are just for presentation purposes and are self-descriptive.
2. Pack all application files into the single ZIP archive. All archived files will be unpacked recusively to the destination folder, so, pay attention to the root folders inside of the archive. Any file in the archive can contain installer variables that can be expanded (substituted) during the installation.
It is suitable e.g. for folder pathes, connection strings in web.config. Variables should be specified in ${variable_name} form. The default installer variables are:
- installer.contentpath - the phisycal path to the application
- installer.website - the name of the target web site
- installer.virtualdir - the name of the target virtual directory
- installer.database.server - the name/IP of the SQL/MySQL server
- installer.database - the name of the database
- installer.database.user - database user
- installer.database.password - database user password
There are can be other custom parameters from pack-specific ASP.NET User Control.
3. Create installation scenario file Install.xml.
The basic structure of the file is:
<?xml version="1.0" encoding="utf-8" ?>
<scenario>
<check>
<sql>
select * from ${installer.database}..sysobjects where name like '${ObjectQualifierNormalized}Portals%'
</sql>
<fileExists path="${installer.contentpath}\web.config"/>
</check>
<commands>
<!-- process copied files -->
<processFile path="${installer.contentpath}/web.config"></processFile>
<runSql path="sql_script1.sql"/>
<runSql path="sql_script2.sql" dependsOnProperty="dotnetnuke.installmembership"/>
</commands>
</scenario>
"check/sql" elements provides an easy way to check the database if there is another application installed. If the result of at least one SQL statement returns some records the installation process will be terminated.
"check/fileExists" elements allow to verify if some files already exist in the destination folder and again, cancel the installation.
"commands/processFile" instructs installer to load the specified file and expand all installer variables (default and custom).
"commands/runSql" instructs installer to run specified SQL file against the target database. Optional attribute is "dependsOnProperty" allowing to execute the script only if the specified variable exists (not null) in variables set. All variables in SQL script will be automatically expanded before execution.
4. Create uninstallation scenario file UnInstall.xml. The file has the same structure as install.xml described above.
5. Create application logo image. It will be presented in DotNetPanel portal on applications list and application properties forms.
6. Create optional custom settings ASP.NET user control.
Some applications may require additional installation options such as "install this or that option", "object qualifier", etc. and they can be specified using your custom control that will be integrated at the bottom of the installation screen.
The basic control may look as the following:
<%@ Control Language="c#" AutoEventWireup="false" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<%@ Implements interface="DotNetPark.DotNetPanel.Modules.IWebInstallerSettings" %>
<%@ Import namespace="DotNetPark.DotNetPanel.Modules" %>
<script language="C#" runat="server">
void Page_Load()
{
}
public void GetSettings(InstallationInfo inst)
{
inst["ObjectQualifier"] = txtQualifier.Text.Trim();
inst["ObjectQualifierNormalized"] = (txtQualifier.Text.Trim() == "") ? "" : txtQualifier.Text.Trim() + "_";
}
</script>
<table cellPadding="2" width="100%">
<tr>
<td class="SubHead" width="200" nowrap>
Database objects qualifier:
</td>
<td width="100%">
<asp:TextBox id="txtQualifier" runat="server" CssClass="NormalTextBox" Text="" MaxLength="5"
Columns="5"></asp:TextBox>
</td>
</tr>
<tr>
<td></td>
<td class="Normal">
Several instances of DotNetNuke can work with the same database simultaneously.
They are separated by mean of database object qualifiers which are just
prefixes for database tables, stored procedures, etc.<br><br>
So, if you install your first instance of DotNetNuke on the selected database,
leave this field blank; otherwise, specify some value, for example 'DNN'.
</td>
</tr>
</table>
It should implement "DotNetPark.DotNetPanel.Modules.IWebInstallerSettings" interface and import required namespaces. "InstallationInfo" is just a hashtable that all custom properties should be placed into.
7. Deploy all application pack files to
"[portal_install_folder]\DesktopModules\DotNetPanel\WebApplications\MyAppFolder" folder. The overall folders structure is shown above.