-1

How can I launch an exe file from Procrun? Apart from that I also tried to launch a frame from the service code itself by specifying the following line in my install script. But that too doesn't work as no GUI is launched though the service is started successfully.

set PR_TYPE=interactive 

If I am to launch an exe using procrun, how am I to do that and if I am to launch a JFrame, how am I to do that? I can't find any similar questions in procrun as all the other interactive java service oriented questions are based on tanuki service wrapper. Please advice.

AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
  • 1
    Anything unclear in the [Procrun documentation](http://commons.apache.org/proper/commons-daemon/procrun.html)? – Seelenvirtuose Mar 03 '16 at 07:08
  • Want to tell me where its mentioned in that documentation about launching external apps/guis from a procrun service? – AnOldSoul Mar 03 '16 at 07:13
  • Parameters are `--StartMode` and `--StartImage`. I know there are a lot of parameters. And because of that you have to study them carefully. – Seelenvirtuose Mar 03 '16 at 07:16
  • StartMode and StartImage have nothing to do with launching external applications right? I do have Start mode set to JVM. I don't have start Image and I don't understand whether start image is talking about launching an external exe from the jar file. – AnOldSoul Mar 03 '16 at 07:20
  • "StartMode and StartImage have nothing to do with launching external applications right?" Wrong! Setting start mode to "exe" with specifying the start image executable is exactly what you want. Setting the start mode to "JVM" ... well ... starts a JVM which is solely for Java programs. – Seelenvirtuose Mar 03 '16 at 08:58
  • If I set the start mode to exe, the service would launch the exe right? That's not what I want. I want the procrun service to launch a jar and then that jar to launch the service. This is so confusing. – AnOldSoul Mar 03 '16 at 09:08

1 Answers1

0

Maybe those articles MSDN - interactive services and SO anser to C# - service-starting-a-process-wont-show-gui explains the problem with a GUI and a service. Better solution would be creating a service and a separate GUI which iteracts with that service.

Community
  • 1
  • 1
SubOptimal
  • 22,518
  • 3
  • 53
  • 69
  • In C#, the GUI could interact with the service through WCF. But how do you do that in Java? – AnOldSoul Mar 03 '16 at 09:09
  • Depends on what your Java service does. RMI, socket, etc.. might a way. Asking Goolge for `java gui interact windows service` revealed [SO - make-an-interactive-windows-service](http://stackoverflow.com/questions/26000543/make-an-interactive-windows-service#26002401) and [commercial product - Java Service Wrapper](https://wrapper.tanukisoftware.com/doc/german/prop-ntservice-interactive.html) . Seems there is no easy way. What does your service do? – SubOptimal Mar 03 '16 at 09:23
  • Its an updater service. While the updating tasks are being carried out by the windows service, I am supposed to display a GUI with progression of the update. So thought of using either C# exe or JFrame to display this progress. Since the service is already built using procrun would be great if I could do something with that itself :( – AnOldSoul Mar 03 '16 at 09:32