Written by Thomas Koetzing on Monday, 01 September 2014
Web Interface can be tweaked by editing or extending the source file(s) because they were "open" meaning you could just use Notepad to see the content and modify whatever you wanted. This required several knowledge from HTML, jScript, CSS, C# and whatever else was used. StoreFront was closed in that area but you could do some changes to the UI mainly by changing some CSS files, if you find the right place.
With StoreFront 2.5 and going forward Citrix has released an SDK for Storefront but what does that exactly mean? SDK – Software Development Kit yes but can you as an admin do anything with it? The main question is how good your C# skills are or how good can you tweak and adopt from given examples? This article will defiantly not a C# introduction but a starting point on how to use the StoreFront SDK and some tips along the way.
Lets start with a picture from the SDK that shows the areas that can be changed. Access conditions, device information, post enumeration, provider list, post launch ica file and post session enumerations can be changed. The included examples gives you a good reference what can be done.
What are the requirements and how would a setup look like? Simplest way is to install StoreFront 2.5.x on a server 2008 R2 or 2012 R2. This will automatically install .NET 4.5. Configure and test that StoreFront works as it should in your environment. Then create an additional Store like "DEV" that will create the Receiver Web site DevWeb Microsoft Visual Studio 2012 or higher is required but it can also be the free express edition. Install Visual Studio on the same machine as StoreFront. Download Citrix StoreFront SDK and unpack it somewhere on the server like C:\SFSDK. You're set, what's next? Review the SDK folder and find the documentation as PDF and the API as Windows help file. Make sure you right click the help file and unblock it so see the actual content. In the folder "solution" you will find the examples but more important also the templates for enumeration, input, launch and session enumeration that you will need for Visual Studio.
Through the templates and Visual Studio you can create custom DLL files for StoreCustomization_Enumeration.dll, StoreCustomization_Input.dll, StoreCustomization_SessionEnumeration.dll and StoreCustomization_Launch.dll. Those files need to be copied into the Store bin folder. Make sure you make a backup of those file(s) by moving them into another folder, don’t just rename them! But don’t worry if you lost the original dll files. Either create another Store or unpack the ResourcesCommon.zip file to retrieve the original files.
Create your own customization Start Visual Studio as administrator with UAC active. Open project and use one of the templates like C:\SFSDK\Solution\Customization_Input\Customization_Input.csproj that will load the project. To simplify you could set the build output to the dev store bin folder by selecting Customization_Input in the project browser (on the right side) and open the properties to set the build path. This way the DLL will created in the right folder and automatically overwritten.
In the project browser pick InputModifier.cs since that is the real C# file that will hold your customization. Citrix developer left a comment: "TODO: Insert your code here." to tell you that’s your starting point for your own code. Again check out the examples and documentation to get some ideas what you can do. I actually tweaked the "ClientName" value for one of my customers. Important is that you must restart IIS and the Citrix Subscriptions Store service once you replaced the DLL’s. On an administrative command line run, IISRESET, NET STOP CitrixSubscriptionsStore, NET START CitrixSubscriptionsStore. Best write a batch that you can run after building the DLL’s
Debug your code With Visual Studio you can debug your code right away but make sure you set the output to debug which is the default. Then go to the debug menu and choose to attach to a process. You must have recently accessed the Receiver Web site (devWeb) to actually get things running. Then pick the w3wp.exe process that refers to the IIS apppool for "Citrix Delivery Service Resources". You don't see the process? A) you haven't launched Visual Studio with administrative rights or B) you have not opened Receiver Web in a Browser. After attaching you can set break points and see code changes in real time. Don't forget to do something in Receiver Web otherwise nothing might happen.
StoreFront Group and Upgrade StoreFront upgrade will simply overwritte the custom DLL files. You can replace them afterwards again and they might work. This mainly depends on Citrix and if they did changes to the StoreFtont API that break your code.
In a StoreFront group you replace the DLL files on one server and by using the propagation action it will automatically push the custom files to all other members.
That's it and not so hard. For me the advantage is I just have to deal with C# and I can debug the code right away. This is much cleaner than Web Interface. Citrix will release soon the StoreFront proxy SDK and will make it even more open for customizations.
StoreFront has defiantly reached the level were you should retire Web Interface.
BIN folder Written by Andreas on 2014-09-03 20:29:29Thanks Thomas, for newbies just to mention this explicitly: you need to copy the customized DLLs to the store's bin folder, NOT to the bin folder of the storeWeb site. This is due to the new architecture where the Citrix resources delivery service is invoked by the "Receiver for Web site" web application which is the one actually presenting you the UI. Also important to know: for the same reason the HttpContext object that is available to you at the customization points does not 100% match the data that you originally send from your browser. So there's a chance that if you rely on custom HTTP headers these are missing at the customization points. Regards, Andreas
BIN folder Written by Thomas Koetzing on 2014-09-03 20:33:59That's why I wrote Dev\Bin and NOT DevWeb\bin
Anyway thanks for bringing that up again Andreas!
Alex Written by Guest on 2015-02-11 20:48:41Hello Thomas,
thank you for that great article! Unfortunately it is not working in my enviroment... is there something different in Storefront 2.6? It would be great if someone could help me.
Written by Guest on 2015-04-28 04:53:09email me please ! i have finished to use StroreFront web api for Programming .
Code Written by HanKlima on 2015-06-16 09:05:06Hallo Thomas, wir wollen bei unserem Storefront auch den Clientnamen anpassen, sodass der Username erscheint. Ist es möglich, dass du den Code dafür hier postest? Man muss das Rad ja nicht neu erfinden
Code Written by Thomas Koetzing on 2015-06-16 09:08:07Hi Florian,
dies war für einen Kunde der dafür bezahlt hat womit ich diesen erst fragen müsste und zudem ist der Code=DLL immer passend zur SF Version. Wenn Citrix was an der API ändert dann geht es nicht mehr und muss neu gemacht werden.
Written by HanKlima on 2015-06-16 12:00:38Ok, kein Problem. Dann beschäftigen wir uns genauer mit dem Thema und bekommen es hoffentlich hin
Written by HanKlima on 2015-06-18 09:59:33Hallo Thomas, ich habe es jetzt einigermaßen hinbekommen, kann allerdings nicht den aktuell angemeldeten Usernamen auslesen. Kannst du mir sagen mit welchem Befehl ich dieses tun kann?
Code Written by HanKlima on 2015-06-18 10:11:59Hallo Thomas,
ich habe es jetzt so hinbekommen, dass der Computername geändert wird. Allerdings bekomme ich den Usernamen nicht ausgelesen. Kannst du mir sagen mit welchem Befehl ich dies tun kann?
Code Written by Gast on 2015-06-19 10:46:56Hallo, ist es möglich nur den entsprechenden Code zum Auslesen des Usernamens zu bekommen?
Code Written by Thomas Koetzing on 2015-06-19 12:29:27Der Benutzername steckt im folgenden Wert. context.UserIdentity.Name
Code Written by HanKlima on 2015-06-20 15:24:10Hallo Thomas,
vielen, vielen Dank - damit klappt es einwandfrei. Du hast mir damit sehr geholfen!
Web Interface SDK / Storefront Written by Gast on 2016-04-18 09:16:56Hallo Thomas,
wir haben mit dem Web-Interface SDK für das Webinterface 5.4 die Anmeldung so gesteuert, das wir von einem andern Portal das NT-Login verschlüsselt übergeben haben und danach sofort die entsprechende Applikation gestartet. Gedanke "Singele Sign On". Ist das mit dem Storefront SDK auch möglich???
Web Interface SDK / Storefront Written by Thomas Koetzing on 2016-04-18 09:41:44Ja sollte
Launching an application with parameters Written by Guest on 2016-04-20 04:09:41I have a couple of questions. I am using storefront 2.6
1) I am looking at passing in a document name or parameters to application that I need launch. I assume that I will override the ica value InitialProgram and add/remove parameters to launch opening a document.
2) Also I assume that I can use the Citrix StoreFront Web API to create links on my intranet website. Is there any further information that you know of on the web to help with this?
I have never implemented using the Storefront any help would be appreciated.