I have a Windows VM with a desktop application on it. I want to write an agent which will interact with this application through UI automation (via WinAppDriver). The agent should start with the machine and require as little human intervention as possible to do its job.
It's easy enough to get this working by adding it to startup programs (shell:startup), but this requires someone logging into the VM every time it is restarted. Is it possible to run such a program as a Windows Service? Keep in mind it would have to launch a Win32 app and interact with it via UI automation. Could this be done by running it as Local System account and enabling "Allow service to interact with desktop"? Or would it need to run as a specific user account?
No, it is because Windows Service runs in background and to access the UI the process should run foreground.