Jump to content
Welcome to our new Citrix community!
  • 0

Publish Powershell command as a XenApp


Question

In order to publish our app, we are using powershell command to download a runnable jar from a remote server and execute the same. The command is configured like below:

 

Path To the executable file:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe

 

Command line argument (Optional):

-windowstyle hidden -Command "Invoke-WebRequest https://<url of remote server>/launcher.jar -OutFile $env:TEMP\launcher.jar";java -jar $env:TEMP\launcher.jar 

 

This above command works fine when invoked from a command prompt, but when launched via citrix, it doesn't work.

When powershell is launched as a standalone app from citrix and then the above published app is launched, it works. 

 

Just trying to find out what could be the reason for such behavior and how to debug this.

Link to comment

8 answers to this question

Recommended Posts

  • 1

Oh, shoot.. I am sorry about the mis-information I provided.

 

I went back and looked at why I said that and did some more testing.

 

First, I found my old PowerShell commands to identify apps that don't launch properly:

$apps = Get-BrokerApplication  -MaxRecordCount 50000 -AdminAddress <delivery controller>
foreach ($app in $apps) {
    $total = $app.CommandLineExecutable.Length + $app.CommandLineArguments.Length + 1
    if ($total -gt 203) {
        $total
        $app
    }
}
 

This goes right along with what you said...limit is 203 characters. My apologies.

 

I then wondered why I said 255...because I am sure I launched an app with a longer command line when I responded earlier.

 

I found an app with a long command line in my environment. Sure enough it doesn't launch as the first application, but it will launch after a successful launch of another application.  

 

 

The workaround normally used is to put the command in a batch file as mentioned by dclark116 earlier in this thread. There is no other configuration I am aware of to get around the annoying limitation.

  • Like 1
Link to comment
  • 0

Depending on how long your "<url of remote server>" is, you could be running up against a commandline that is too long for Citrix to handle. I don't remember the exact length off the top of my head, but it is close to what you have, including Path to exe and command-line args. 

 

Update: https://discussions.citrix.com/topic/382604-published-application-parameters-limit

Looks like maybe 255 character limit but there are a couple "hidden" characters so I think the real limit ended up being like 253 characters in my previous testing. 

Edited by Dennis Parker
Add character limit information
Link to comment
  • 0

This turned out to be due to command length limit. Based on testing I found that the supported length is 204 characters (which includes path to executable and command line arguments). Anything beyond 204 characters is not working. We were assuming that anything under 255 chars will work.

 

Is there a way or configuration to support more characters?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...