The WebHostAutomation Ltd Development Network
Show Changes Show Changes
Edit Edit
WHA Website WHA Website
WHA Forums WHA Forums
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Rename Rename
Search

History

5/31/2007 12:30:21 AM
adam.saunders@webhostautomation.com
5/31/2007 12:29:40 AM
adam.saunders@webhostautomation.com
5/30/2007 3:38:05 PM
adam.saunders@webhostautomation.com
5/30/2007 3:34:01 PM
adam.saunders@webhostautomation.com
5/24/2007 11:54:32 PM
adam.saunders@webhostautomation.com
List all versions List all versions
Developing Application Packs
.

About Application Packs

Application Packs are collections of web scripts and web applications that can be installed with a simple click of a button into a users website. This section of the wiki will show you how easy it is to develop your very own application packs.

You can download a sample application pack by Clicking Here

The Basics

Developing an application pack couldn't be easier. The pack consists of just two parts. The first part is the files themselves that you wish to install into the users webspace plus any sql scripts that may be appropriate to the application pack. The second part is an xml file that describes the application pack and what the pack does when the user installs it.

You can do a lot more than just installing or uninstalling some files into a website. You can manage a database for the web application and can even specify post installation actions. These are actions you want to offer to the user for when they have already installed the web application. For example you may want to allow the user to clear out their database to start again, or reset their login details.

The Config.xml File

Getting Started

Before you start writing your application pack the first thing you should do is ensure you have installed the Application Pack module for Helm 4 onto your development machine. You can do this using the HelmConfigurationTool and accessing the module list section.

Once the module is installed, you'll need to make sure that you have set up a IIS web service inside Helm for the server. The Application Pack service properties will show up on the same page as the rest of the IIS settings. If you do not see this and you have installed the module, then it might be that the service was added before the module, you just need to perform a server refresh.

In the module service properties in Helm there will be an application path which is by default C:\ApplicationPacks. Change this if you wish to install your application packs elsewhere on the server.

To get started with writing your Application Pack you need to generate a GUID for yourself. You can use a range of tools to do this for you such as visual studio or this site .

Create a new folder in the C:\ApplicationPacks folder called the same as the GUID. For example..

 C:\ApplicationPacks\382D1526-464F-45a1-B7A4-F624EF576D34.

Create a new text file called config.xml and place this into the application pack folder you just created. Now that you have created your config.xml file you just need to fill it with the correct information. The config.xml file is a valid XML file as the extension indicates, so it is recommended to use a good XML editor in order edit the application pack file to ensure its valid and well structured.

Note

Information Section

The first thing you need to do now is to tell the application pack installer about the module you are developing. So create the following XML in your file.

 <ApplicationPack guid="382D1526-464F-45a1-B7A4-F624EF576D34">
   <Information>
   </Information>
 </ApplicationPack>

We now have to popular the Information node with details of the application pack you are writing. So within the <Information></Information> tags place the following..

Name

*Required* This is the name of your application pack that will appear in the available application pack list. Usually this will be simple the name of the web script that is being installed.

 <Name>Sample Application Pack</Name>

Description

*Required* The description of the application is shown within the list of available packs and as such should be short and sweet. A single sentance and no bigger as it will clutter up the interface and will less likely be installed.

 <Description>This is a sample application pack installation script to show how flexible the app pack installer is. Use the form provided to install me!!</Description>

Product Version

*Required* This is the version of the script that is being installed. This is used later on when it comes to allowing the user to upgrade and for the app pack installer to understand whether the user has a new version available to them.

 <ProductVersion>2.0.0.0</ProductVersion>

Product Logo URL

You can provide a URL to a image/logo of the product. The image should be 120px wide with a height of no more than 80px. Its high recommended to place a single pixel black border around the image too in order to ensure it suites the interface no matter which skin is used.

 <ProductLogoURL>http://www.webhostautomation.com/images/AppPacks/sampleapppack.gif</ProductLogoURL>

Product Licence

This is a really useful feature that isn't required, however it will allow you to ensure that the user has agreed to any terms or conditions to the use and installation of the application pack. For some licenced products, this is legally required.

 <ProductLicence requiresagreement="True">Terms of use
 You can use this for free because it costs nothing.
 Thanks for choosing the sample app pack!</ProductLicence>
Attribute Description
requiresagreement If the user has to agree to the terms you can set the requiresagreement attribute to True. The user can not then install the application until they click an "I Agree" checkbox.

Uninstalled Page Description

This is the text that will appear on the page that allows the user to install the application pack.

 <UninstalledPageDescription>This is details of the Sample Application Pack. If you wish to install this application pack fill in the details below and click the install button.</UninstalledPageDescription>

Installed Page Description

This is the text that will appear on the page that allows the user to uninstall the application pack or perform post installation methods.

 <InstalledPageDescription>This is details of the Sample Application Pack that you have installed on your domain website. In the unlikely event you wish to uninstall this application pack, click the Uninstall button below.</InstalledPageDescription>

Installation Section

So now you have enough information for your application pack to show up in the list of available application packs under a domain. What you now need to do is to tell the application pack installer how to do the actual installation and also what is required of the users domain configuration in order to run the application. This information is added in to the <Install> section of the config.xml file.

Add into the config.xml file underneath the </Information> tag the following

 <Install>
   <Requirements>
   </Requirements>
   <Properties>
   </Properties>
   <Actions>
   </Actions>
 </Install>

Installation Requirements

Within the <Requirements> tags you can add details of what the application requires in order to be installed into the users website such as what scripting language support they need, what database type they may need.

Can Install To Root?

You can set in the requirements whether the user is allowed to install the script into the root of their webspace or not. Some applications have to run from a sub folder instead of the route of the drive.

 <CanInstallToRoot value="False" defaultpath="sample" fixed="False" hidden="False" />
Attribute Description
value True or False. Indicates that the user can or can not install the application into the root of their webspace
defaultpath This is a default installation path that the user will see when they click to install the script
fixed This is an optional attribute that specifies whether the user has the ability to pick an installation or whether the defaultpath is a fixed installation location.
hidden This is an optional attribute that specifies whether the user can see where the installation path with be or is. This is useful for application packs that don't actually install a product and moreover make modifications to existing files or perform a process of some kind.

Virtual Directory?

You can tell the application pack installer whether a virtual directory is required in order to run the application. Some web applications that require their own application space will need virtual directories. This is an optional tag and is only required if its absolutely necessary.

 <VirtualDirectory required="True" defaultname="myShop"/>
Attribute Description
value True or False. Indicates that the virtual directory is required or not. If the entire tag is missing then the application pack will assume that its not required.
defaultpath This is a default virtual directory path that the user will see when they click to install the script

Database?

If the web application required a database, then include this tag into the requirements section. This will tell the application pack installer to request a database, or new database details from the user when they go through the installation process.

 <Database type="MSSQL" version="2005" />
Attribute Description
type This is the type of database that the script requires. The value is either "MYSQL" or "MSSQL".
version This is an optional attribute that specifies that the script will only work with a specific version of the database. For MSSQL this would be 2000 or 2005 and MYSQL would be 4 or 5. Missing the attribute out or having it as blank will means that the user can chose any version of that database type

Scripting Support

Most web applications are based on a scripting language of one kind or another. To ensure that the application is successful to run after the installation process, you can provide the following tags in the requirements section. You can specify more than one of these tags in case there are more than one versions that the user can select from such as PHP4 or PHP5.

 <Script type="ASP" version="2" />
Attribute Description
type This is the scripting engine that is required to be available for the website before the application can be installed . The value is either "ASP", "ASP.NET", "PHP", "PERL", "PYTHON", "COLDFUSION"
version This is the version of the script such as 1 or 2 for ASP.NET, 4 or 5 for PHP etc

Installation Properties

 <Property type="System" name="AutoRemoveFiles" datatype="Boolean" default="True" />
 <Property type="User" name="ShopName" friendlyname="Name of the Shop" datatype="String" regularexpression="" minimumvalue="2" maximumvalue="255" default="Sample Shop" />
 <Property type="User" name="ShopDescription" friendlyname="Description of the Shop" datatype="TextAreaSmall" isrequired="True" regularexpression="" minimumvalue="0" maximumvalue="255" default="My new shop!" />
 <Property type="User" name="ShopType" friendlyname="The Type of Shop you want" datatype="Enum" isrequired="True" default="0">
   <Option value="0" friendlyname="General" />
   <Option value="1" friendlyname="Electronic" />
   <Option value="2" friendlyname="Fruit" />
   <Option value="3" friendlyname="DVDs" />
   <Option value="4" friendlyname="CDs" />
  </Property>
  <Property type="User" name="EnableUsers" friendlyname="Enabled User Access" datatype="Boolean" isrequired="True" regularexpression="" minimumvalue="-1" maximumvalue="-1" default="False" />

Installation Actions

The actions are a list of functions that performed in order to install the application. For a list of functions that are available see the Actions Reference Guide

Actions Reference Guide

Scripting Properties

Within the actions its possible to use tag text elements that represent runtime values about the installation. Every action attribute is parsed for these and the relevant value is put in place of the tag text. The available properties are shown below.

Tag Example
[$Property.nameofproperty] This is for User and System properties defined in the script where "nameofproperty" is the name provided in the property declaration
[$Website.RootPath] C:\Domains\Domains.com
[$Website.WebRootPath] C:\Domains\Domains.com\wwwroot
[$Website.InstallPath] C:\Domains\Domains.com\wwwroot\myShop\Scripts
[$Website.RelativeInstallPath] myShop\Scripts
[$Website.VirtualDirPath] myShop
[$Database.Required] True
[$Database.Type] MSSQL
[$Database.Version] 2005
[$Database.Name] mydb
[$Database.Username] mydbuser
[$Database.Password] pa$$word
[$Database.ServerAddress] mssqlserver1
[$Domain.Name] sampledomain.com
[$AppPack.Path] C:\Application Packs\382D1526-464F-45a1-B7A4-F624EF576D34
[$AppPack.PackPath] C:\Application Packs
[$AppPack.GUID] 82D1526-464F-45a1-B7A4-F624EF576D34
This is a information store of developing modules and addons for Helm 4.

If you are new to Wiki, read OneMinuteWiki or VisitorWelcome.

Recent Topics

  • DevelopingApplicationPacks
  • HomePage