1

I run Jenkins slaves as a windows service, which will then launch a chain of calling (for example):

Slave.exe->ant->cmd batch->notepad.exe

The problem is that "notepad.exe" is not visible, I can see it in task manager, but it doesn't show its UI.

The windows platform is win server 2008, and I have configured the service "Log on as the Local System Account", with "Allow service to interact with desktop" checked.

Any ideas about this? Thanks a lot

Cfinley
  • 1,435

2 Answers2

1

As of Windows Vista, all services run in a separate session (session 0) and cannot normally interact directly with the user, even if "Allow service to interact with desktop" is set. In other words, you aren't supposed to do that. Can't you run slave.exe within your logon session?

However, as a backwards compatibility mitigation measure, Windows is supposed to detect that a service has presented a user interface and offer to display it to you (on a separate desktop). I'm not sure why this wouldn't be working. Is the service configured to run as Local System?

Harry Johnston
  • 5,914
  • 8
  • 34
  • 58
1

I ran in to a similar issue trying to kick off some automated scripts web testing scripts (that needed a GUI).

This is the trick. You need to start up remote desktop connection, set it up to kick off an .exe once the connection starts, enter and save a authentication information, and save the connection to disk.

Have jenkins kick off the saved RDP connection and it should initiate a GUI for you.

Also if you are running multiple windows commands in jenkins you need to have each command as separate items (if they return an exit code.. like if you are calling two .bat files or something)

brakertech
  • 201
  • 2
  • 4