Jump to content

Recommended Posts

Posted

Hey guys,

I'm having a problem when trying to run my autoit executable inside a docker container (Docker for Windows) "mcr.microsoft.com/windows:1909" image (was trying with windowsservercore:1909 image but went to the complete one when this problem first showed). I am aware that windows image requires a compatible version to your machine (that's why I'm using 1909 and not the latest).

The script goes through an exe installation smoothly in my windows machine. On containers, it executes, opens the executable, reads the window text, but it seems unable to send inputs, like "ControlClicks", "ControlSends" and "Send" after a "WinActivate", thus making interacting with the executable impossible.

So, with that in mind, I came back to a simpler example like this:

#include <Constants.au3>
#pragma compile(Out, 'teste.exe')
#pragma compile(Console, True)
#RequireAdmin
Opt("WinTitleMatchMode" , 2)
ConsoleWrite(WinGetTitle('Untitled - Notepad') & @CRLF)
ConsoleWrite(WinGetText('Untitled - Notepad') & @CRLF)
ControlSend("Untitled - Notepad", "", "Edit1", "This is some text")
WinActivate('Untitled - Notepad')
Send("dadasdadad")
ConsoleWrite(WinGetTitle('Untitled - Notepad') & @CRLF)
ConsoleWrite(WinGetText('Untitled - Notepad') & @CRLF)
WinWait('dsdadasdads') ; Just to let the program hanging and the console output still open so I can read

I am opening notepad manually before the exe execution, I confirm it is running on the container through "tasklist" command and I alway see "notepad.exe" running in there.

Again, in my machine, it executes and prints the text and the title. However, in the container, it does not send any input and the title is unchanged (cannot see the "*" denoting changed content) and textcontent print is completelly blank.

Does anybody know about this weird interaction? Am I doing something wrong? Does windows container have some kind of limitation regarding receiving programatic inputs?

I am having a hard time finding anything related to this topic.

Thanks in advance and sorry for the possible bad English.

Posted

I don't think so... I've created an user on Dockerfile and assigned it to Administrator.

Here's the command on Dockerfile

RUN net user /add custom-admin
RUN net localgroup Administrators custom-admin /add
USER custom-admin

Then I run "whoami" then "net user custom-admin" to confirm I have admin rights:

C:\install>whoami
whoami
8c3d47b0eef2\custom-admin

C:\install>net user custom-admin
net user custom-admin
User name                    custom-admin
Full Name
Comment
User's comment
Country/region code          000 (System Default)
Account active               Yes
Account expires              Never

Password last set            ‎6/‎15/‎2020 11:13:09 AM
Password expires             ‎7/‎27/‎2020 11:13:09 AM
Password changeable          ‎6/‎15/‎2020 11:13:09 AM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   ‎6/‎15/‎2020 11:20:34 AM

Logon hours allowed          All

Local Group Memberships      *Administrators       *Users
Global Group memberships     *None
The command completed successfully.

So this confirms I got admin rights on container or am I misunderstanding?

If not problems with admin rights, what could it be?

Posted

I have no experience with Docker containers but, if the container is a vm of sorts, it just may have no access to the other isolated apps., or at least no controls/GUI manipulation of other protected apps. .
I'm answering 'cause I hate waiting for an answer, personally. But until someone that knows comes by, hope this is something you can look at.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

Hey, thanks for the response! It's what I am thinking that the container has some sort of limitation regarding control/GUI manipulation.

Meanwhile, if anyone knows anything about this topic I'd be grateful to discover what's happening exactly.

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...