Streaming FTA Config tool to add FTA's using Streaming Profiler SDK
Description
The tool StreamingAppFTAConfig adds a file type association ( FTA ) for an application to a profile and all the targets in a profile. The tool can also list the FTAs configured for the profile and also for all the applications in each of the targets within the profile.
Tool Version : 1.0
Download Link ( Click here )
Target FTA Configuration limitation using Profiler SDK
Refer to Known issues section particularly "You must manually add File Type Associations (FTAs): " note in the Profiler SDK readme at http://community.citrix.com/display/xa/Readme+Citrix+Profiler+SDK+1.2
The section is also pasted below for easy reference avoiding the need to browse the above link.
<Snip
This release has a restriction against programmatically adding FTAs at the target level. As a workaround, you can manually edit the manifest (.profile) file to add target level FTAs. If you need to add FTAs programmatically at the package level, you must add the FTA manually at the target level for the package to be valid and in a consistent state.
The .profile file contains XML-formatted information. As a result, an SDK user can add XML information to this file in some cases. For example, if an FTA associates "notepad.exe" with ".txt" extensions, you can insert the following code in place of the <FTA> segment of [Package/Apps/App] and [Package/Targets/Target/Apps/App]:
<FTAs>
<FTA>
<Name>NOTEPAD.TXT</Name>
<Description>Standard Text File</Description>
<Extensions>
<Extension> .txt</Extension>
</Extensions>
<MimeTypes />
<Executables>
<Executable> NOTEPAD.EXE</Executable>
</Executables>
</FTA>
</FTAs>
With this XML code inserted into the .profile file, the FTAs associated with an application are properly publishable.
</Snip>
Details
By now you have seen that Apps are available at both profile level and also at target level.
And as FTAs are associated with an app, FTAs also have to be there at profile level for an app and also at the target level for the same app. One can say that FTA for an app at package level is the superset of all the FTA's available for the same app in different targets in that profile.
Lets get into more detail on FTA support in profiler SDK and how the tool uses to list and add FTAs fixing the limitation along.
FTA Support in Profiler SDK
Profiler SDK support quite a few interfaces with different methods and properties which operate on FTAs. This is listed below with a basic diagram.
- IRADEFTA
- IRADEFTACollection
- FTAs property of IRADEPackageApp and IRADETargetApp

One can use the above interfaces to list/add/remove FTAs in a profile and targets. One can explore and see different methods/properties availale for these in the profiler SDK chm help file and extend and add more features in and around FTA. Below are few examples to show how to use it.
How to list FTAs
Step 1 : Open a profile in edit mode
IRADEPackage profile = new CRADEPackageClass();
IRADETarget target = new CRADETargetClass();
profile.Open(profilepath); // path to .profile
profile.Edit(profile.BuildLocation); // only requried while editing the profile like while adding new FTA below.
Step 2 : Get package app Collection
IRADEPackageAppCollection pkgAppCol = profile.Applications as CRADEPackageAppCollection;
Step 3 : For each app in the package app collection get FTA collection
foreach (IRADEPackageApp pkgApp in pkgAppCol)
{
IRADEFTACollection ftacol = pkgApp.FTAs as CRADEFTACollectionClass;
Step 4 : For each FTA in FTA collection list the different properties
foreach (IRADEFTA eachfta in ftacol)
{
System.String[] extstr = (string[])eachfta.Extensions;
System.String[] appstr = (string[])eachfta.Executables;
Console.WriteLine(ftacount, eachfta.Name, eachfta.Description, extstr.GetValue(0), appstr.GetValue(0));
}
Note - For targets , simply replace "Package" to "Target" in interfaces and you are mostly done. This can be followed as a general rule.
The above would use target interfaces instead of package interfaces
Example - Instead of IRadePackageAppCollection one would have IRadeTargetAppCollection for each target ( assuming that one could get target collection using Targets property of IRADEPackage ).
How to Add FTAs
Adding FTA needs to be done both at profile level and also at target level for an app. FTA only at profiler level will not be of any use alone as it is the targets or client platforms on which these associations have to take effect for an app.
Step 1 : Create an FTA object as below with all the details.
IRADEFTA newfta = new CRADEFTAClass();
newfta.AddExtension(newextension);
newfta.AddExecutable(pkgApp.Name); // name of the application in the package
newfta.Description = newextdescp; // your fta description
newfta.Name = newextnm; // your fta name
Step 2 : Add the new FTA to FTA collection.
IRADEFTACollection ftacol = pkgApp.FTAs as CRADEFTACollectionClass;
Step 3 : Save the profile
profile.Save();
The above will add FTA to a profile. But we need to add the FTA for the same app to each target also. Currently SDK doesn't support that and so one has to manipulate the XML file to add this. As specified in the known limitation
How to use the tool
1. Copy the utility localy to your client machine say C:\ and launch cmd.exe and run the utility giving different arguments.
Command Line Details - Type StreamingProfileFTAConfig.exe /? to see the details like below.
The tool offers two switches /ListFTA to list the FTA details and /AddFTA to add fta details in a profile.
Streaming Profile FTA Config Usage:
================================================
StreamingProfileFTAConfig.exe /ListFTA profilepath
-Lists the FTA details for a profile
StreamingProfileFTAConfig.exe /AddFTA profilepath applicationname extens
ion extensionname extensiondescription
-To add a new FTA , where...
profilepath - is path to .profile of the profile. Eg - f:\myprofile\myp
rofile.profile
applicationname - is application name to which the new extension should
be associated
One could use /ListFTA to get the app name
extension - new extension. Eg - .newext
extensionname - Eg. My ext name
extensiondescription - Eg. my description
Usage Examples
- StreamingProfileFTAConfig.exe /ListFTA "F:\mynewprofile\mynewprofile.profile"
- StreamingProfileFTAConfig.exe /ADDFTA "F:\mynewprofile\mynewprofile.profile" "My Text reader application" ".readme" "readme extension" "readme description"
Note :
1. Make sure to take a backup of your profiler folder before using the tool on any profile.
Requirements - .Net 2.0 , Streaming Profiler SDK 1.2 ( Setup done following the Profiler SDK readme )
Disclaimer
These software applications are provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.
Comments (1)
Sep 24
Lukas Pravda says:
Looks nice. Possible extraction/export FTA setting for nonstreaming purposes wou...Looks nice. Possible extraction/export FTA setting for nonstreaming purposes would be nice. (For example export to reg file.)
Add Comment