Programming | Preparing an Extension for publishing

Modified on 2011/05/28 12:49 by Eugene — Categorized as: API

In order to prepare your Extension to be published in the Extensions section of the site and let the user control it via the Extension Manager, you need to perform these steps:


using System;
using System.Collections.Generic;
using System.Text;
using WealthLab.Extensions.Attribute;

// Information for the Extension Manager [assembly: ExtensionInfo( ExtensionType.Provider, "Yahoo WMS", "Yahoo! Finance Static, Real-Time and Fundamental", "Yahoo! Finance provides end-of-day data for U.S. and world equities, mutual funds, indices and futures.", "1.3.4.0", "Wealth-Lab Management Software", "WealthLab.DataProviders.Yahoo.Resources.Yahoo.png", ExtensionLicence.Freeware, new string[] { "WealthLab.DataProviders.Yahoo.dll", "WealthLab.DataProviders.Yahoo.pdb"}, PublisherUrl = @"http://www.wealth-lab.com")]


The ExtensionInfo attribute

The ExtensionInfo attribute has required parameters declared in its constructor and optional properties. Below you will find their description and usage guidelines. Constructor parameters are underlined.

Type - Extension type enumeration:


StrongName - Extension's Strong name which will clearly identify it. We recommend using a dual word string:

MyShortNameExtension MyShortNameCompany

For example: "Yahoo WMS".


DisplayName - Under this title the Extension will appear in the Extension Manager and on the website's Extensions section.


Description - A short description of the Extension.


Version - Version of Extension. Enclose a usual numerical sequence in quotes - "x.x.x.x" (e.g. 1.3.4.0)


Publisher - Your company name.


Glyph16x16Name - Resource name containing the Extension's logo (16x16 pixels; see example). Specify Build Action for the glyph equal to "Embedded Resource" in Properties window.


Licence - Extension's licence type enum. Possible options:


DeleteFiles - String array containing file names to be deleted when the Extension is uninstalled.


PublisherUrl - Returns a URL that points to a web page that could be used to describe the Extension or provide additional information about its publisher.

Glyph100x100Name - Resource name containing the Extension logo (100x100 pixels). Specify Build Action for the glyph, equal to "Embedded Resource" in Properties window.

LicencePrice - Price of the Extension. Used together with ExtensionLicence.Commercial. Note that Commercial Extension should care of its proper usage - i.e. ask for a registration key, keep an eye on trial days counter etc.

HostApp - A target app for the Extension. Available choices:


HostApp=ExtensionHostApp.Developer

MinProVersion, MaxProVersion - Minimum and maximum version number of Wealth-Lab Pro 6 supported by your Extension. Do not specify any values for these and similar properties for "Developer", if your Extension is designed to be compatible with any version of WL6.

MinDeveloperVersion, MaxDeveloperVersion - Same as above, but applies to "Developer" (international release of "Wealth-Lab", available for downloading from the wealth-lab.com site)

MinDeveloperVersion = "6.0"

Not supported in current Wealth-Lab version:
PreInstallBatch, PreUpdateBatch, PreUninstallBatch, PostInstallBatch, PostUpdateBatch, PostUninstallBatch - Batch file name (*.bat or *.cmd) to be executed at the moment indicated by the property name. To execute a batch file, the Extension Manager launches cmd.exe process with the following parameters:

cmd.exe /x /c "cd /d "[WealthLabDir]"&&"[ExtensionTempDir][NameBatchFile]""

Use batch files if any additional action is required in order to properly set up the Extension - registering a COM object and so on. For example, your Extension needs to register MyCOM.dll with the help of regsvr32.exe on destination computer. Create a batch file called "RegisterMyCOM.cmd" with the following text:

%windir%\system32\regsvr32.exe MyCOM.dll

Specify appropriate file name in the PostInstallBatch property. Create the other batch files which will re-register the class library when Extension is updated and unregister MyCOM.dll before unistalling.

Batch files launched by the Extension Manager on a computer running under Windows Vista will always be executed with Administrator privileges. Their execution will require user's permission in the UAC (User Account Control) at runtime, as well as entering Administrator's password - if he is logged in with standard user privileges.

Testing on a local computer

Shut down Wealth-Lab and place your Extension with ExtensionInfo in Wealth-Lab directory. Start Wealth-Lab and select Extension Managеr from the Tools menu. Check if attributes were specified correctly.

Samples


You can find these zipped source code by clicking on "Attachments" on top of the page. Wealth-Lab Developer/Pro customers who can't see "Attachments" - please enter a new support ticket at wealth-lab.com.