Streaming Profiler XML Tool
Introduction
The Streaming Profiler XML Tool is a .NET-based command line utility that takes as input an XML file that describes a given set of activities related to the Streaming Profiling process. The tool is based on the Streaming Profiler SDK, and it is provided as source code. This document explains how to build and use the tool once you get the SDK from http://community.citrix.com/display/xa/Streaming+Profiler+SDK.
Here follow the main features of the SDK:
1.Simple to use - like any command line tools it is simple to use.
2. XML configuration - Using XML config file one can configure the apps to profile and run it to create/update profiles for multiple targets very easily.
3.Silent command line install for creating/updating profiles - One can give unattended command line installs in XML file to have as much less manual intervention during profile creation/updating.
4.Support for normal, Inter-Isolation Profiles ( dependent and aggregate profiles ) - One can create all types of profiles using this tool.
5. Update configurations - One can update few configurations like apps/scripts etc using the tool.
Credits
Download
About the Streaming Profiler and the SDK
Profiling is one of the first steps in using Citrix Application Streaming or Client Side virtualization Xenapp feature.
Common Profiling tasks for an admin may include one or more of the following
1. Updating a profile adding/deleting more targets
2. Udpating the profile when a new SP/hotfix comes.
3. Updating Some Configurations ( which could be either in registry or some files )
4. Configuring different attributes like apps/binaries/scripts/FTA's etc associated with a profile.
If not entirely then mostly all the admins would do this using profiler UI and for each target profiling machine. This takes considerable time.
Consider how painful it would be if admin has to update 10-100 profiles each having multiple targets say with a new pre launch script or similar configuration.
All the streaming managemnt above involves manually clicking through various screens in the Profiler UI to complete the profiling and can become a tedious and cumbersome management task.
As the adoption to streaming technology grows I think management and user experience would become as important as the new features.
Streaming Profiling SDK is one powerful tool which admins and ISV's can use to provide streaming profile management solutions and streamline some of the above tasks.
Using Citrix Streaming Profiler SDK one can do a lot and the benefit is that one can customize and use the SDK the way it suites custom needs.
Showcasing the power of Citrix Streaming Profiler SDK I will introduce to Streaming Profiler XML Tool which is based on Citrix Streaming Profiler SDK 1.2 . The tool is by any means not a replacement of the Profiler UI but a way of showing how different customers or even ISV's can build customized solutions around streaming profiling.
How to build the tool?
1. Configure a machine to use Citrix Streaming Profiler SDK
Download the SDK and follow the installation instructions given in Welcome->"To Install the profiler SDK"
2. Download the tool and unzip it
Link to be provided here once uploaded on CDN.
Unzip will give
a. src folder - Source code of the tool.
b. XmlConfigSampleFiles folder - Few Sample configurations files.
3. Build the tool sources following the below steps.
a. Open the solution file in visual studio 2005.
b. In the solution explorer right click on references and add a reference to radesdkpia.dll
c. Build the solution
4. Create a xml file based on task one wants to do and run the tool specifying the xml file in the command line.
Usage
StreamingProfilerXmlTool.exe <ConfigXmlFile>
StreamingProfilerXmlTool.exe getdetails <profileLocation>
Where
| ConfigXmlFile | It is the path to the xml file which will be used by the tool to create the profile with the specified settings in the xml file. For more on xml settings see xml settings section later in the doc. |
| getdetails | This can be used from command line to read details of a profile and targets in the profile |
| ProfileLocation | Location to .profile file where the profile is located. |
APIs demonstrated
- IRADEPackage2
- IRADETarget
- IRADETargetCollection
- IRADETargetOS
- IRADETargetOSCollection
- IRADEScript
- IRADEScriptCollection
- IRADEPackageApp
- IRADEPackageAppCollection
- IRADETargetApp
- IRADETargetAppCollection
- IRADEFTA
- IRADEFTACollection
XML configuration capabilities
This section describes examples of how to create XML configurations for completing diverse tasks. The examples are included in the download under the XmlConfigSampleFiles folder.
In addition to the included examples, one can create Inter-Isolation or linked profiles of dependent types.
Other potential uses include, among others, updating some config file for the app for all the targets, or updating some registry value.
XML Configuration
| ProfileType | NormalProfile or AggrP2PProfile or MasterSlaveProfile |
| ProfileName | User defined name of the profile |
| TargetName | User defined target name while creating a new one or while updating a specific target resolved using this name. |
| BuildLocation | Build location where the profile gets build |
| ProfileLocation | Profile location where profile would be created and saved |
| WorkingDir | Working directory to be used while profiling |
| InstallPath | Installer exe or msi location to be run .While doing update of other properties one can choose "" which will not install and just update |
| InstallCommandLineArguments | One can specify any command line arguments for the installer |
| RunDiscovery | Normally should be 1 |
| UpdateProfile | Update profile should be 1 while updating and creating new profiles/targets |
| Script | One or more nodes of this type to add scripts |
| App | One or more nodes to add apps in the profile |
| ExePath | Path of exe to be run. One can have more than one node of this type. |
| ExeParam | For every exepath there should be a corresponding ordered exeparam where one can specify space separated arguments |
Example 1 - Create a New Normal profile on say XP SP3.
The below is one of the config file which can be used to create a normal profile for textpad.
<Configuration>
<Settings>
<!-- Profile Type - give one of NormalProfile or AggrP2PProfile or MasterSlaveProfile -->
<ProfileType>NormalProfile</ProfileType>
<!-- Profile name -->
<ProfileName>ProfileTextpad</ProfileName>
<!-- Use Target Name when creating a new one or specify which target to update while updating -->
<TargetName>Mytargetname</TargetName>
<!-- Build location path to be used while building the profile -->
<BuildLocation>F:\profiles</BuildLocation>
<!-- Profile location where the new profile would be created -->
<ProfileLocation>F:\profiles</ProfileLocation>
<!-- Working directory while creating the profile. -->
<WorkingDir>F:\profiles</WorkingDir>
<!--Installer exe or msi location to be run .While doing update of other properties one can choose "" which will not install and just update -->
<InstallPath>f:\setups\TextPad4.7\txpeng473.exe</InstallPath>
<!-- command line arguments to the installer. one can leave it empty if no arguments -->
<InstallCommandLineArguments></InstallCommandLineArguments>
<!--Usually should be 1.-->
<RunDiscovery>1</RunDiscovery>
<!-- If the UpdateProfileExe value is to be used for updating the profile with additional binary then make it 1 otherwise make it 0 -->
<UpdateProfile>1</UpdateProfile>
</Settings>
</Configuration>
Run the tool using the commandline StreamingProfilerXmlTool.exe NormalProfile.xml
The above will create a textpad profile. One can see the profile details either by opening in Profiler UI or through command line of the tool ie by running StreamingProfilerXmlTool.exe getdetails <Profilelocation>
Note: One can also specify unattended command line install command with parameters in the config file to even avoid clicking install sequence for the app.
Example 2 - Update the profile from example 1
We will update the profile created above with a script.
As we dont want to run the application launcher again so make the InstallPath empty.
<!--Installer exe or msi location to be run .While doing update of other properties one can choose "" which will not install and just update -->
<InstallPath></InstallPath>
Add the details for the script like below to the config file and run the tool again.
<!-- If the UpdateProfileExe value is to be used for updating the profile with additional binary then make it 1 otherwise make it 0 -->
<UpdateProfile>1</UpdateProfile>
<!-- script details which needs to be added in the profile or target
format should be scriptlocationpath,parameters to script,profile level=1 or target = 0, isolated=1,prelaunch=1-->
<Script>C:\script1.bat,,1,1,1</Script>
The zip file contains UpdateNormalProfileSample.xml which shows how to update textpad profile created in example 1 and use scripts to update the profile.
Again simple run the tool giving xml file as input.
StreamingProfilerXmlTool.exe UpdateNormalProfileSample.xml
The above will update the textpad profile we created in example 1. One can see the profile details either by opening in Profiler UI or through command line of the tool ie by running StreamingProfilerXmlTool.exe getdetails <Profilelocation>
Note:
TargetName has to be set to the actual target name to be updated. If its not set and is "" then tool would try to find the matching target OS with the OS on which it is running and if found update that target.
Like above there are following features added which can be used.
1. Update by runing exe's inside the profile. Could be used to update the profile.
<!-- exes which can be run outside the profile --> <ExePath>D:\Projects\Practicals\HelloWorld\Debug\HelloWorld.exe</ExePath> <ExeParam>hello1 Hello2 hello3</ExeParam> <ExePath>D:\Projects\Practicals\HelloWorld\Debug\HelloWorld2.exe</ExePath> <ExeParam>hello11 Hello22 hello33</ExeParam>
2. Update Apps available in the profile.
<!-- use this to add apps if they are not detected or one wants to add custom apps existing in the profile --> <App>abc,Device\C\abc.exe</App> <App>abc2,Device\C\abc2.exe</App>
Example 3- Adding a new target
For adding a new target one needs to change the targetname to some new name for the new platform and then run the tool on the new target platform.
<!-- Use Target Name when creating a new one or specify which target to update while updating --> <TargetName>MyNEWtargetname</TargetName>
Example 4 - Inter-Isolation Profiles
The below config file would create a linked profile for firefox and textpad in the same profile. Just run the tool with last parameter as aggrp2p
<Configuration>
<Settings>
<!-- Profile name - either a new profile name to be created or profile name to open when updating -->
<ProfileType>AggrP2PProfile</ProfileType>
<ProfileName>Profilenew</ProfileName>
<TargetName>Mytargetname</TargetName>
<!-- Profile location or path where the old profile resides or the new profile has to be saved -->
<BuildLocation>F:\profiles</BuildLocation>
<ProfileLocation>F:\profiles</ProfileLocation>
<WorkingDir>F:\profiles</WorkingDir>
<InstallPath>""</InstallPath>
<InstallCommandLineArguments></InstallCommandLineArguments>
<RunDiscovery>1</RunDiscovery>
<UpdateProfile>1</UpdateProfile>
<SubProfileLocation>f:\Profiles</SubProfileLocation>
<SubProfile>Profiletextpad</SubProfile>
<SubProfile>Profilefirefox</SubProfile>
</Settings>
</Configuration>
Future thoughts
One can even extend and make a solution as big as like IM,installation manager where from centralized managment console one can create/update for all the profiles and all the targets. That would really ease the management pain in all respects.
With that said you can experiment with the tool, play with Streaming Profiler SDK to write your own customizations and share your experiences with us.
Requirements
Minimum SDK version: Profiler SDK version 1.2 or later.
Minimum operating system: Windows XP SP2 or later.
.Net 3.0
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.
Add Comment