As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Difference between revisions of "Deploying a Custom Add-In Task"

From sasCommunity
Jump to: navigation, search
(Added info about using .NET 2.0 and later)
m (.NET Releases)
Line 11: Line 11:
 
Custom tasks for AMO 2.1 can be written in later versions of .NET and will be recognized as long as they meet the interface requirements. That documentation is available by downloading [http://support.sas.com/documentation/onlinedoc/guide/customtasks/SAS.Shared.AddIns.zip the documentation] from the link ''Creating Custom Add-In Tasks for SAS Enterprise Guide.''
 
Custom tasks for AMO 2.1 can be written in later versions of .NET and will be recognized as long as they meet the interface requirements. That documentation is available by downloading [http://support.sas.com/documentation/onlinedoc/guide/customtasks/SAS.Shared.AddIns.zip the documentation] from the link ''Creating Custom Add-In Tasks for SAS Enterprise Guide.''
  
SAS Enterprise Guide 4.2 and SAS Add-In for Office 4.2 support .NET 2.0 and later.  You can create custom tasks using the most recent development tools from Microsoft and target .NET 2.0, 3.0, and 3.5.  You can even use the "free" versions of [http://www.microsoft.com/express Microsoft Visual C# Express or Microsoft Visual Basic Express].  SAS has a preliminary getting started guide [http://support.sas.com/documentation/onlinedoc/guide/customtasks/samples/zqj_EG42CustomTasks.zip available here].
+
SAS Enterprise Guide 4.2 and SAS Add-In for Office 4.2 support .NET 2.0 and later.  You can create custom tasks using the most recent development tools from Microsoft and target .NET 2.0, 3.0, and 3.5.  You can even use the "free" versions of [http://www.microsoft.com/express Microsoft Visual C# Express or Microsoft Visual Basic Express].  SAS has a preliminary getting started guide [http://support.sas.com/documentation/onlinedoc/guide/customtasks/samples/zqj_EG42CustomTasks.zip available here (ZIP file with doc and example)].
  
 
==Deploying a Custom Add-In Task for Use==
 
==Deploying a Custom Add-In Task for Use==

Revision as of 08:41, 3 December 2009

Custom Tasks can be added to SAS® Enterprise Guide 4.1 and the SAS® Add-in for Microsoft Office 2.1.

See Creating Custom Add-In Tasks for SAS Enterprise Guide on the SAS support site for details and examples for creating your custom tasks that can be run in both SAS Enterprise Guide (EG) and the SAS Add-In for Microsoft Office (AMO).

NOTE: These instructions are specific to the releases listed above. More options will be available with the next release (4.2). Note also that tasks created for 4.1/2.1 can still work in 4.2 - so there should be no compatibility issues.

.NET Releases

Enterprise Guide 4.1 requires that custom tasks be written in .NET 1.1 (or earlier). The most recent .NET release is 3.5 and SAS Enterprise Guide 4.2 will supports that release. See SAS EG and .NET_2.0 for a way to write a wrapper that may enable using later releases of .NET for Enterprise Guide 4.1 custom tasks.

Custom tasks for AMO 2.1 can be written in later versions of .NET and will be recognized as long as they meet the interface requirements. That documentation is available by downloading the documentation from the link Creating Custom Add-In Tasks for SAS Enterprise Guide.

SAS Enterprise Guide 4.2 and SAS Add-In for Office 4.2 support .NET 2.0 and later. You can create custom tasks using the most recent development tools from Microsoft and target .NET 2.0, 3.0, and 3.5. You can even use the "free" versions of Microsoft Visual C# Express or Microsoft Visual Basic Express. SAS has a preliminary getting started guide available here (ZIP file with doc and example).

Deploying a Custom Add-In Task for Use

A custom add-in task ships within a .NET assembly (or DLL file). You may have multiple tasks within a single .NET assembly or simply organize them as one add-in task per file, depending on your preference. Usually it is convenient to package several related add-in tasks together into a single assembly, because it makes it easier to share code and implementations among the tasks.

Once the .NET assembly has been built, deploying and registering to target client machines is simple, using one of two methods, described below. Once added, the add-in tasks will be available in from the Add-In menu in SAS Enterprise Guide, as well as in the task list. In the SAS Add-in for Microsoft Office, you will find the new entries when you select Analyze Data.

You register/deploy custom tasks for both Enterprise Guide and AMO using the same technique.

Method 1: "Drop-in" Deployment

You no longer need to perform a separate registration step in order for SAS Enterprise Guide 4.1 or the SAS Add-In for Microsoft Office 2.1 to recognize your custom task. Instead, you can simply copy the assembly (dll) to a special directory and the application will recognize it automatically the next time that you start the application.

The special directory is commonly:

 C:\Program Files\SAS\Shared Files\BIClientTasks\Custom 

Note that the first part of the path (C:\Program Files\SAS\Shared Files) may vary depending on your installation (e.g. it may be SAS Institute instead of SAS).

The Custom directory may not exist. However, if the the BIClientTasks directory exists, you have likely found the correct directory and you will need to create the Custom directory.

NOTE: If your custom task depends on other assemblies that ship with SAS Enterprise Guide 4.1 or the SAS Add-In for Microsoft Office 2.1, those files do not need to be copied to the Custom directory. If your custom task depends on other assemblies (either 3rd party or that you developed), you do need to copy those to the Custom directory along with the dll for the task.

Method 2: Using the Add-In Manager

NOTE: This method only works for custom tasks written using .NET 1.1.

  1. Copy the .NET assembly (and any dependent assemblies that your implementation might reference, excluding those provided with SAS Enterprise Guide or the SAS Add-in for Microsoft Office) to a location on the target machine. If you plan to deploy more than one assembly with add-in tasks, you might want to designate a single directory to group them together.
  2. If SAS Enterprise Guide is installed:
    1. Start SAS Enterprise Guide.
    2. Select Add-In->Add-in Manager...
  3. If the SAS Add-in for Microsoft Office is installed (and SAS Enterprise Guide is not):
    1. Run "C:\Program Files\SAS\Shared Files\BIClientTasks\4\RegAddin.exe" (the actual location of this program might vary depending on your installation).
  4. Regardless of whether you used step 2 or 3 above, the Add-in Manager dialog allows you to register new add-in tasks by simply browsing to the .NET assembly.
  5. Use the Browse button to navigate to the folder where your add-in assembly is located and then click Open. The Add-in Manager shows the available tasks within the assembly that you selected.
  6. Click OK to accept the add-ins.

Changes with Enterprise Guide 4.2

With SAS Enterprise Guide 4.2 and SAS Add-In for Microsoft Office 4.2, there are multiple special folders that the application will scan for custom tasks. For SAS Enterprise Guide, the folders are:

  • %appdata%\SAS\EnterpriseGuide\4.2\Custom (for just the current user)
  • C:\Program Files\SAS\EnterpriseGuide\4.2\Custom (for all users)

For SAS Add-In for Microsoft Office, the folders are:

  • %appdata%\SAS\AddInForMicrosoftOffice\4.2\Custom (for just the current user)
  • C:\Program Files\SAS\AddInForMicrosoftOffice\4.2\Custom (for all users)

And finally, if you want to deploy a single copy of a custom task in both applications, you can copy it to this one special folder:

  • %appdata%\sas\SharedSettings\4.2\Custom (for just the current user)

The "%appdata%" notation is a Microsoft Windows environment variable that maps to your personal profile area, which is specific to your user account on the machine. This allows you to add custom tasks to your installation without affecting any other users who might share your machine.

Note: if your custom task depends on other assemblies (DLLs) that ship with SAS Enterprise Guide or SAS Add-In for Microsoft Office, you do not need to copy those files to the Custom directory. If your custom task depends on assemblies that are not supplied by SAS (either 3rd party or that you developed), you do need to copy those to the Custom directory along with the task.