Jump to content
Sign in to follow this  
drapdv

Issue with UIAWrappers.au3 when compiled

Recommended Posts

So, I have this odd issue happening with UIAWrappers.  When I run simplespy.au3 through SciTE, it finds the object I'm trying to work with, no problem. But, when I compile simplespy.exe, it can't find it.  Another script that utilizes UIAWrappers is experiencing the same phenomenon. EDIT: Compiling as 32-bit or 64-bit does not affect this behavior.

The trouble starts at the very first object I try to get via _UIA_getObjectByFindAll, so I included the $properties2Match array and the object properties that were returned by _UIA_getPropertyValue for that first object both when running from SciTE and when compiled.

It always finds the matches for the title and control type properties.  But when compiled, it fails to find the Automation ID property.  Any ideas as to why this would be happening?  Hoping junkew will see this and have an idea.

 

These are the $properties2Match

30005|Screen/PVN - ###.###.##.## - CDK Drive|0|False
30003|50032|0|False
30011|Portal|0|False

 

Object properties when running from SciTE:

<propertymatching>       
        j:1 propID:[30005] expValue:[Screen/PVN - ###.###.##.## - CDK Drive]actualValue:[Screen/PVN - ###.###.##.## - CDK Drive]1
        j:2 propID:[30003] expValue:[50032]actualValue:[50032]1
        j:3 propID:[30011] expValue:[Portal]actualValue:[Portal]1  :)
</propertymatching>

 

Object properties when script is compiled:

<propertymatching>
        j:1 propID:[30005] expValue:[Screen/PVN - ###.###.##.## - CDK Drive]actualValue:[Screen/PVN - ###.###.##.## - CDK Drive]1
        j:2 propID:[30003] expValue:[50032]actualValue:[50032]1
        j:3 propID:[30011] expValue:[Portal]actualValue:[]0  :o
</propertymatching>

 

Edited by drapdv
Included results of compiling as 32/64-bit application

Share this post


Link to post
Share on other sites

no clue , never observed that behavior (and 99.99% of the time I do not use automationid as identifying property)

  • leave the property out and if duplicates use as alternative instance:## or indexrelative construction
    if you can find it that way you could retrieve the automationid to see what the actual value is
  • check with inspect.exe to see if you have similar behavior on the object you try to recognize
  • sometimes it makes a difference in which order you start the applications

 

Share this post


Link to post
Share on other sites

First of all, thank you for your reply, and for developing this UDF.  I literally couldn't do my job without it!

Second, I figured it out...I ran SciTE as admin, but compiled so it would run without requiring admin rights.  The (poorly obfuscated) screenshot below shows what simplespy could identify when run as admin (left) and when run with standard rights (right).  With admin rights, it cycled through 40 objects to get the one I needed.  Without admin rights, it cycled through only 16, and they were different than the first 16 found when run with admin rights.  Weird deal, but that's how it goes. 

Anyway, basic reminder to UIA people - check your 32/64-bit settings and admin privileges if things aren't behaving.

 

SimpleSpy - Admin vs Reg.jpg

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
Sign in to follow this  

  • Similar Content

    • By SgtHugoStiglitz
      HI people,
                        I got a questions, I maintain code in autoIT and every time I compile a new version or modification, Scite generate 2 folders. One folder is finish by released and the other is tentative. I try to make some google search, but never find answer would satisfied myself. The dev who was maintain it before were using AutoIt3Wrapper_GUI, and I don't know if it's related. I look both folder, but they seem pretty identical, but I would like to know what it's the difference between those to folder. Anyone have a clue?
    • By Rhidlor
      I don't have any experience compiling AutoIt scripts or know of any best practices regarding said scripts so I was wondering, what are some of the options for passing data to complied scripts? Here's an example of what I mean by "option": Writing data to a text file, then running a script which reads the data from that text file.
      Thanks!
      I apologize if this topic is a little lackluster
    • By Skeletor
      Hey All,
      Yes, this is an odd request. 
      But is there a way to bulk up the size of the compiled program? 
      I know many want to reduce it's size, but I want to increase it.
      What methods do you suggest?
    • By dimm
      Is it possible to compile script without any icon resources included?
      When I make exe it uses default system icon of current OS even if I compile as console application.
      On other versions of Windows it looks a little strange

       
      Update:
      It seems that the only way is remove icons from exe after compilation using resource editors like ResHacker.

       
      another bad solution:
      Using corrupted 35 bytes icon file. Windows can't load it and shows default system icon.
      #pragma compile(Icon, broken.ico) broken.ico
    • By Skeletor
      Hi All,
      It has been bugging me for a while now. 
      Can you view the AutoIt code from within a compiled exe. Like how you can with most .Net exe's by using a certain program.
      If this is possible, how then can I secure my program (if this method exists).
       
×
×
  • Create New...