How to unhide an application window started by Jenkins "windows command"? - jenkins

I have defined a third party application to run as part of job finalizing process in a "windows batch command":
"C:\Program Files\Folder\App.exe"
Jenkins runs this and it works fine. but sometimes the App.exe is waiting for user action cause something went wrong, but since the application window is hidden I dont know what went wrong.
Is there a way to ask Jenkins to not hide the application window started by the windows batch command?
The jenkins is running as a windows service and using the same account as the logged in user on the jenkins box.

Nope and it isn't Jenkins fault. In Windows NT operating systems, a Windows service is a computer program that operates in the background.
In former Windows version there was a option "Allow service to interact with desktop" but since Vista the setting no longer works.

Related

Actual meaning of windows services

I just want the explanation to the question 'what does windows services basically means?' I want some real time example that i can relate 'windows services' with?
Windows services are background running processes. they dont have UI. Windows services are installed in windows based machines to do some particular tasks on the background like a job. Windows Services has .exe extension but cannot run like a application.
click 'start' in your windows machine, type 'services.msc' and press Enter. This will open windows services installed in your current machine with their active status. If you stop some service, Some relevant application may misbehave. i.e, If any windows application that uses this service for some background job the application would crash.
Antivirus scan, Task scheduler which does some task at specified time are examples of windows services.
In development perspective windows services has
OnStart event (Fires when services start)
OnStop event (Fires when services stop)
timerElapsed event (if you set the interval as 15 seconds, this event fires every 15 seconds)
These services can be created using windows services template in visual studio and installed, uninstalled using 'installutil'
installutil -i servicepath\service.exe (installs service)
installutil -u servicepath\service.exe (uninstalls service)
Windows services can also host wcf services with mex binding. if you have any particular question do let me know. accept if it is useful

What happens to TFS Build service when running in Interactive Mode?

I am trying to setup a build agent to build my Win8 app, which I'm told I should be able to do on a Server 2012 machine.
Everything was going well, until the step told me to stop the build service and run it in 'interactive mode'.
What this appears to do, it make the service run with a command prompt saying "I'm running in interactive mode, press escape when done" (When I pressed escape the build service stopped).
My question is this, if I need to run the build service in interactive mode for win8 builds, how will I cope for the inevitable situation when the server restarts, or some admin logs the user out? presumably the build service will stop.
Is there a better way to handle this?
unless there is a specific reason why you need to run in interactive mode, i was building win8 apps all last year on a 2012 server running with out interactive mode and it ran fine. try it without and see what happens

PsExec gets stuck on licence prompt when running non-interactively

I have a Hudson build script which calls the SysInternals PsExec utility. Normally, when PsExec is run for the first time by a given user it pops up a dialog box asking the user to accept the licence. The build agent runs as a service and I can see that the build gets stuck at PsExec. Process Explorer shows that PsExec is running, so I strongly suspect it's displaying that same prompt, but because it's running non-interactively there is no way to accept the prompt. Is there any way to get around this silly limitation? Running on Windows Server 2008 R2 x64.
Use the /accepteula command-line switch to accept the licence agreement.
Or set
HKCU\Software\Sysinternals\PsExec\EulaAccepted
to 1
Caution: if the reg key above is set to 0 (EULA was declined once) then the /accepteula will not work, you have to set the key to 1 manually (or delete it altogether).
It's documented, but you have to use the 2003 version or higher.

Windows Service doesn't start automatically

I have a windows service written in .Net 3.5 set to be automatically start, but it wouldn't start when system reboots.
As I understand, it may be caused by my service's dependency aren't started when the services tries to start. I don't know what my service depends on. I tried the workaround by adding windows print spooler as one of my service's dependencies, since print spooler is one of the services start quite late during the boot-up. Well, the work around doesn't work neither.
I'm using windows server 2003 r2. so the "delayed automatically restart" option is not available to me. and I can't use windows server 2008 just for this.
I'm out of ideas at the moment. Any suggestion would be appreciated.
A few suggestions to try out:
Check the system even logs
Add logging to your service, e.g. to system event log or use log4net
Strip the service down to a single message in the start-up or create a new stripped-down minimal service with as little dependencies as possible. See whether this starts
Check under which account your service is running and whether this account has the permission to "Run As A Service"

Running an exe from windows service that interacts the the user's desktop

I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it. When I open Task Manager - i can see that the application is running but I just cannot see it. I have checked "Allow the service to interact with the desktop" but nothing happens. Please help.
Is it possible to run and exe from within a windows service and see the exe running in widnows server 2003?
Showing UI from a Windows service is very problematic because the service may be running on a different desktop from the user (and on Vista/Server 2008 will in fact always run on a different desktop).
The easiest solution is to run the UI not directly from the service but from an application running on the user's desktop (maybe set to run at login) that communicate with the service somehow.
Just remember:
There may be no logged in user
There may be multiple logged in users using fast user switching or remote desktop
The application on the user desktop is running in the user's security context, not the service's

Resources