|
From: Christian M. <chr...@ta...> - 2011-05-31 02:27:00
|
Lars, If you are running your application from the user context/session on windows and try to launch the Wrapper in order to interact with the Service (for e.g. start/stop the service) then the Wrapper will request elevation, if the process doesn't have appropriate privileges yet. It doesn't matter if the Wrapper was launched from console or through the JVM by Runtime.exec(). I only would suggest you call waitFor() on the process once launched since the Wrapper will pause as long as the User has granted/denied elevation to the Process. It's currently not possible to call the service update from the WrapperManager API (this is what I think you meant). If you want to update the service without reinstalling it, you would have to create a process for the Wrapper with that option from inside your application with Runtime.exec() or ProcessBuilder, or the WrapperManager.exec(). Please let me know if you have any further questions. Best Regards, Christian On Mon, May 30, 2011 at 7:27 PM, Lars Schnoor <Lar...@if...> wrote: > Hi Leif > > The problem is that I would like to be able to start the service from a > Java program, I have a System Tray program that allows me to perform > actions on the service and I can already restart and stop the service, > so I would like to be able to start the service as well. I would like to > be able to start the service from a Runtime.exec(), is that possible? > Is it possible to use the -u option from within the wrapper? > > Lars > > On 30-05-2011 11:35, Leif Mortenson wrote: >> Lars, >> When running under Windows 7, you will need to open an elevated >> Command Prompt to do this. In the start menu, right click on the >> Command Prompt icon and you will see the option to launch as an >> administrator. All of the methods will then work from there. >> >> Starting with version 3.5.7, the Wrapper should also try to elevate >> itself if you run "wrapper -t" from a normal console. >> >> Please let me know how this works for you. >> >> Cheers, >> Leif >> >> >> >> On Mon, May 30, 2011 at 6:15 PM, Lars Schnoor<Lar...@if...> wrote: >>> Hi Christian >>> >>> I have tried the "sc", "net" and "wrapper -t" method and I always get an >>> access denied message, I am running Windows 7. >>> >>> Lars >>> >>> On 30-05-2011 10:40, Christian Mueller wrote: >>>> Lars, >>>> >>>> this is currently possible with the -u option of the Wrapper binary. >>>> If you run the wrapper conf file with the -u parameter the wrapper >>>> will update the properties of your service without uninstalling and >>>> reinstalling it. However, if the application was running as a service >>>> at the time you are trying to update the service, the Wrapper will >>>> first stop the server. >>>> For instance: >>>> bin\wrapper -u ..\conf\wrapper.conf >>>> >>>> There are many ways of starting the service, apart from the services dialog: >>>> >>>> - directly through the Wrapper by running the Wrapper with the parameter "-t" >>>> bin\wrapper -t ..\conf\wrapper.conf >>>> - the Install-App.bat file (which will implicitly call the Wrapper >>>> binary with "-t") >>>> - the Windows command-line tool "sc", i.e. sc start [Service Name] >>>> http://ss64.com/nt/sc.html >>>> - the Windows command-line tool "net", i.e. net start [ServiceName] >>>> http://ss64.com/nt/net_service.html >>>> etc... >>>> >>>> please let me know if you have any further questions on this. >>>> >>>> Best Regards, >>>> Christian >>>> >>>> On Mon, May 30, 2011 at 4:48 PM, Lars Schnoor<Lar...@if...> wrote: >>>>> Hi >>>>> >>>>> Some time ago I asked if the wrapper.ntservice.starttype could be set >>>>> and would have effect after the service is installed and I was told that >>>>> it could be set but that it would not have effect, has this been >>>>> changed/fixed? I would like to change the mode from AUTO_START to >>>>> DEMAND_START or reverse without uninstalling and installing the service. >>>>> I would also like to ask if there is a way to start the service after >>>>> installing it without restarting the computer or manually going into the >>>>> Services dialog and starting it that way? >>>>> Thanks >>>>> >>>>> Lars >> ------------------------------------------------------------------------------ >> vRanger cuts backup time in half-while increasing security. >> With the market-leading solution for virtual backup and recovery, >> you get blazing-fast, flexible, and affordable data protection. >> Download your free trial now. >> http://p.sf.net/sfu/quest-d2dcopy1 >> _______________________________________________ >> Wrapper-user mailing list >> Wra...@li... >> https://lists.sourceforge.net/lists/listinfo/wrapper-user > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > |