|
From: Leif M. <le...@ta...> - 2003-02-04 02:53:46
|
That sounds like it would work nicely. Is there an api for that which I am unaware of or do you have to loop over the registry items at /HKEY_LOCAL_MACHINES\SYSTEM\CurrentControlSet\Control\Session Manager\Environment That seems to be where the system wide environment variables are set. I suppose that I could then call setenv on each entry. Once that is done, the rest of the code should work as is... My system also has settings in the following two registry folders: /HKEY_LOCAL_MACHINES\SYSTEM\ControlSet001 /HKEY_LOCAL_MACHINES\SYSTEM\ControlSet002 But I assume that the CurrentControlSet is the one we would want... Leif Rich Taylor wrote: >I ran into a similar situation with environment variables. > >I am setting the APP_HOME environment variable the installshield >script, then installing the wrapper service with the following line in my >wrapper.conf: >wrapper.java.classpath.1=%APP_HOME%\lib\*.jar > >Because of the way the NT service manager doesn't reload environment >variables this doesn't work until after the machine is rebooted(as you >discussed earlier). > >Currently we are just working around this, but I think it should be >possible to add a configuration options like: >wrapper.ntservice.envFromRegistry=true > >When this property is set, the wrapper would query the windows registry >directly. > >I don't know if this would work for you Mikkel, but it was a thought I >had. I just need to find the time to go implement it. > >Rich > >On Sun, 2 Feb 2003, Mikkel Damsgaard wrote: > > > >>Date: Sun, 2 Feb 2003 10:09:02 +0100 >>From: Mikkel Damsgaard <mi...@co...> >>To: wra...@li... >>Reply-To: wra...@li... >>Subject: Re: [Wrapper-user] Re: Defining enviroment variable on the command >> >> > line. > > >>Sender: wra...@li... >> >> >> >>>Couldn't you modify the script which installs the service so that the >>>replacement is done >>>within the script rather than in the conf file. I have always done it >>>as follows: If you place >>>this in your script: >>> >>>--- >>>set APP_HOME=C:\app >>>set JAVA_HOME=C:\jdk1.3 >>>wrapper -i %APP_HOME%\wrapper.conf >>> >>> >>wrapper.java.command=%JAVA_HOME%\bin\java >> >> >>>--- >>> >>>Then the replacements all happen in the script so the parameters passed >>>to the wrapper >>>are all replaced. The full command that is then stored in the registry >>>looks like this: >>>--- >>>wrapper -s C:\app\wrapper.conf wrapper.java.command=C:\jdk1.3\bin\java >>>--- >>>At run time no environment variables are used so things work correctly. >>> This should give >>>you the exact same functionality as you are requesting? >>> >>> >>> >>I could, but I wont be able to use %APP_HOME% in the .conf file, and I will >>have to specify everything >>depending on %APP_HOME% on the comand line. In my case about 10-15 >>variables, such as >>java.classpath stuff. Besides when changing the classpath, you I will have >>to reinstall the service >>for it to take effect. >> >>/Mikkel >> >> >> >>>Cheers, >>>Leif >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.NET email is sponsored by: >>>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! >>>http://www.vasoftware.com >>>_______________________________________________ >>>Wrapper-user mailing list >>>Wra...@li... >>>https://lists.sourceforge.net/lists/listinfo/wrapper-user >>> >>> >>> >> >>------------------------------------------------------- >>This SF.NET email is sponsored by: >>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! >>http://www.vasoftware.com >>_______________________________________________ >>Wrapper-user mailing list >>Wra...@li... >>https://lists.sourceforge.net/lists/listinfo/wrapper-user >> >> >> > > > > >------------------------------------------------------- >This SF.NET email is sponsored by: >SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! >http://www.vasoftware.com >_______________________________________________ >Wrapper-user mailing list >Wra...@li... >https://lists.sourceforge.net/lists/listinfo/wrapper-user > > > |