Sandy89

Methodology to use autoit in citrix desktop

6 posts in this topic

#1 ·  Posted (edited)

Hi,

I have a script that uses image identification for selection, and it works fine in my local environment. but when I try running it in citrix desktop, images are not getting identified. I didn't install autoIT in citrix since I don't have admin rights, but copied the entire application folder with images and .dll files into a folder in citrix.

can anyone help to resolve this?

Edited by Sandy89

Share this post


Link to post
Share on other sites



applications must be created by the administrator citrix, it will include links to dll libraries that the program needs, otherwise the concept of Citrix would be stupid, if each user could insert random applications. Anyway Ask your admin to add it to your desktop.

Share this post


Link to post
Share on other sites

the script (copied to citrix desktop as .exe file) is running fine except the image recognition (using imagesearch.au3) in citrix.

I want to click on an image in the active window in citrix while executing the script.

I stored the screenshots of the required objects to be clicked in script folder, along with imagesearch.dll

Share this post


Link to post
Share on other sites

I repeat dll 4 your citrix desktop. Ask to your Admin to compile it and redistribuite.... obviously must register the library dll.

So how can I use ImageSearch and enjoy it's awesome benefits?

First of all to avoid mostly caused problems I recompiled DLLs for both architectures which you can download at end of this post. When you pick your package you should place both ImageSearch.au3 and ImageSearch.dll inside script folder.

 

Share this post


Link to post
Share on other sites

 Currently it cant be added to the desktop library. It is working fine in one of the citrix desktop (in UDE). but not in the other one.

 

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • BigDaddyO
      By BigDaddyO
      I have a bunch of scripts that I need to run on systems that are either accessed from RDP or Citrix.
      The problem I have had all along is that if you close the RDP or Citrix screen then the scripts will fail even if the user is still logged into the system you were connected to.
      I finally found something that will tell me if the session is still active but it's a command line tool called qwinsta.exe.  I prefer not to do stdoutread if there is any other way so I'm wondering if anyone has an idea on how to get the session state for the currently logged in user as this script does but not using stdoutread?
      $RunFrom = EnvGet("Sessionname") ConsoleWrite("Active SessionName = " & $RunFrom & @CRLF & @CRLF) Local $iPID = Run('"C:\Windows\System32\qwinsta.exe" ' & @UserName, "", @SW_HIDE, 2) ProcessWaitClose($iPID) ;Need to wait for it to finish before we get the StdOutput values $sOutput = StdoutRead($iPID) ;Retrieve whatever returned ConsoleWrite("Active StdOutRead = " & @CRLF & $sOutput & @CRLF & @CRLF) ;---------------------------------------------------------------------------------------- Sleep(15000) ;Need to disconnect at this point so we can see what happens next!!! ;---------------------------------------------------------------------------------------- $RunFrom = EnvGet("Sessionname") ConsoleWrite("Disconnected SessionName = " & $RunFrom & @CRLF & @CRLF) ;After Lock, again get session name and session state and write to console Local $iPID = Run('"C:\Windows\System32\qwinsta.exe" ' & @UserName, "", @SW_HIDE, 2) ProcessWaitClose($iPID) ;Need to wait for it to finish before we get the StdOutput values $sOutput = StdoutRead($iPID) ;Retrieve whatever returned ConsoleWrite("Disconnected StdOutRead = " & @CRLF & $sOutput & @CRLF)  
      Below is what i'm seeing returned by the script.  What I need is just the STATE field.
      From RDP:
      Active SessionName = RDP-Tcp#0 Active StdOutRead = SESSIONNAME USERNAME ID STATE TYPE DEVICE >rdp-tcp#0 MyUsername 3 Active rdpwd Disconnected SessionName = RDP-Tcp#0 Disconnected StdOutRead = SESSIONNAME USERNAME ID STATE TYPE DEVICE > MyUsername 3 Disc  
       
      From Citrix:
      Active SessionName = ICA-CGP#9 Active StdOutRead = SESSIONNAME USERNAME ID STATE TYPE DEVICE >ica-cgp#9 MyUsername 43 Active wdica Disconnected SessionName = ICA-CGP#9 Disconnected StdOutRead = SESSIONNAME USERNAME ID STATE TYPE DEVICE > MyUsername 43 Disc  
      Thanks,
      Mike
    • MuffinMan
      By MuffinMan
      I have been working on an script for work now for quite some time and I finally worked through all my bugs and have the script working great on my desktop.  My ultimate goal however is to run this script on top of another web app as part of a Citrix published app.  However it looks like _IEAttach doesn't want to recognize any browser instances when ran as a published app in Citrix.  It runs fine if I login to Citrix and run it from a desktop.  I found this old thread, but it looks like it was never resolved.
      '?do=embed' frameborder='0' data-embedContent>>
      I have requested authorization to load AutoIT and sciTE on the Citrix server, but I have not heard back from the admin yet.  I do have a folder on the Citrix server where I can copy my EXEs to for testing.  I'm using straight AutoIT help examples below to show the issues I am seeing so that they will be easy to recreate.
      When I compile the WinList HelpFile Example and run it from the Citrix server it sees my browser instances as windows:
      #include <MsgBoxConstants.au3> Example() Func Example() ; Retrieve a list of window handles. Local $aList = WinList() ; Loop through the array displaying only visable windows with a title. For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1]) EndIf Next EndFunc ;==>Example But when I compile and run one of the HelpFile _IEAttach examples (below) and run it from the Citrix server, it immediately errors out with:
      Line 201 (File "M:StickyNotesIEInstance.exe" ):
      Error: Variable must be of type "Object".
      #include <IE.au3> #include <MsgBoxConstants.au3> Local $aIE[1] $aIE[0] = 0 Local $i = 1, $oIE While 1 $oIE = _IEAttach("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ReDim $aIE[$i + 1] $aIE[$i] = $oIE $aIE[0] = $i $i += 1 WEnd MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE[0]) I am really so close on this and I would really appreciate any help you guys could spare.
    • BobRoss
      By BobRoss
      Hi All,
      Now before I start, I have trawled through the forum & elsewhere for the last 24 hours or so & found nothing to even point me in the right direction.
      I have a rather large script that's doing various (AD reads & applying RegWrites based on the SID & AD reads....) & I've stripped it all back & the problem appears to lie with the create object which is calling a sproc I wrote to pull back various based on params passed.
      Now for the actual issue, all worked fine first time everywhere apart from within a Citrix xenapp session which is when I'm getting hit with the Exception Occured Script Line -1 - Variable must be of type 'Object'.
      Here is a stripped back portion which I've been testing with against xenapp (with a MsgBox added to easily see if anything did return), can anyone notice anything glaringly stupid that I'm doing?
      Global $AppError = ObjEvent("AutoIt.Error","ErrFunc") $Emp=@UserName $adDSN="Driver={SQL Server};Server=*****;Database=*****;Uid=****;Pwd=*****" $adCN = ObjCreate ("ADODB.Connection") $adCN.Open ($adDSN) $FNsQuery = "exec [ooo_sp_ad_user] @user="&$Emp&",@type=1" $FNresult = $adCN.Execute($FNsQuery) $ADFirstName=$FNresult.Fields("").Value MsgBox(0, "AD Test", $ADFirstName) $adCN.Close Func ErrFunc() Local $HexNumber Local $strMsg $HexNumber = Hex($AppError.Number, 8) $strMsg = "Error Number: " & $HexNumber & @CRLF $strMsg &= "WinDescription: " & $AppError.WinDescription & @CRLF $strMsg &= "Script Line: " & $AppError.ScriptLine & @CRLF MsgBox(0, "ERROR", $strMsg) SetError(1) Endfunc Any pointers at all would be greatly appreciated.
      Thanks
      Bob
    • colombeen
      By colombeen
      How do you check a script error on a line that doesn't exist?
      I only have a bit more then 300 lines but the error is on line 1359.
      are lines from included files also counted?
      If so, the error is coming from a constants file.
      can anybody help me with this?
      FYI : the error only occurs when opening the exe file on a citrix session (not a normal computer)
      It states:
      AutoIt Error
      Line 1359 (File: "H:sdsslvpn.exe"):
      Error: Variable used without begin declared.
      If needed I can upload the script