Auto launch Citrix published apps in Chrome

Since Google disabled NPAPI support in Chrome browser XenApp and XenDesktop publications autostart doesn’t work anymore.

The only way to get this functionality back is to enable the “always open files of this type” when you download an ICA as explained here. This has to be done once for each user. To get rid of this anoying work around, you’d have to edit the Chrome’s Preference file for each user.


You can also run the following VBS script in the user context (at logon or in an Active Setup during your next Receiver deployment).

' Set auto launch ICA files in Chrome browser
sPrefPath = g_objWshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\AppData\Local\Google\Chrome\User Data\Default"
Set g_objFSO = CreateObject("Scripting.FileSystemObject")
Set objFileIn = g_objFSO.OpenTextFile(sPrefPath & "\Preferences", ForReading)
sIn = objFileIn.ReadLine()
Set objRegex = new RegExp

'Pattern for auto opened extensions
objRegex.Pattern = "\""extensions_to_open\"":""[^""]*"""
objRegex.Global = True
Set myMatches = objRegex.Execute(sIn)
sFounded = myMatches(0)

'If no extension already parametered
if Instr(sFounded, "extensions_to_open"":""""") Then
                sReplaced= """extensions_to_open"":""ica"""
Else 'If at least on extension parametered
                sExistant = Split(sFounded,"""")
                'if ica extension aready parametered
                if Instr(sExistant(3), "ica") Then
                               'no replacement
                               sReplaced = sFounded
                Else 'add ica to the list of extensions
                               sReplaced= """extensions_to_open"":""" & sExistant(3) & ":ica"""
                End If
End If

'replace the string in the target file
sOut = objRegex.Replace(sIn, sReplaced)
'Kill Chrome.exe
g_objWshShell.Run "taskkill /F /IM Chrome.exe /T", , True
set objFileOut = g_objFSO.CreateTextFile(sPrefPath & "\Preferences",True)

Citrix, mobility & virtualization @Work / father, husband & geek @home

Tagged with: , ,
Posted in Citrix

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: