|
From: Mikkel D. <mi...@co...> - 2003-02-04 07:35:38
|
SHGetValue:
DWORD SHGetValue( HKEY hkey,
LPCTSTR pszSubKey,
LPCTSTR pszValue,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData
);
Search msdn.microsoft.com for shgetvalue.
>>> le...@ta... 02/04/03 03:53am >>>
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=20
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=20
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=20
>script, then installing the wrapper service with the following line in =
my=20
>wrapper.conf:
>wrapper.java.classpath.1=3D%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=3Dtrue
>
>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:
>
> =20
>
>>Date: Sun, 2 Feb 2003 10:09:02 +0100
>>From: Mikkel Damsgaard <mi...@co...>
>>To: wra...@li...=20
>>Reply-To: wra...@li...=20
>>Subject: Re: [Wrapper-user] Re: Defining enviroment variable on the =
command
>> =20
>>
> line.
> =20
>
>>Sender: wra...@li...=20
>>
>> =20
>>
>>>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=3DC:\app
>>>set JAVA_HOME=3DC:\jdk1.3
>>>wrapper -i %APP_HOME%\wrapper.conf
>>> =20
>>>
>>wrapper.java.command=3D%JAVA_HOME%\bin\java
>> =20
>>
>>>---
>>>
>>>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=3DC:\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?
>>>
>>> =20
>>>
>>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
>>
>> =20
>>
>>>Cheers,
>>>Leif
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.NET email is sponsored by:
>>>SourceForge Enterprise Edition + IBM + LinuxWorld =3D Something 2 See!
>>>http://www.vasoftware.com=20
>>>_______________________________________________
>>>Wrapper-user mailing list
>>>Wra...@li...=20
>>>https://lists.sourceforge.net/lists/listinfo/wrapper-user=20
>>>
>>> =20
>>>
>>
>>-------------------------------------------------------
>>This SF.NET email is sponsored by:
>>SourceForge Enterprise Edition + IBM + LinuxWorld =3D Something 2 See!
>>http://www.vasoftware.com=20
>>_______________________________________________
>>Wrapper-user mailing list
>>Wra...@li...=20
>>https://lists.sourceforge.net/lists/listinfo/wrapper-user=20
>>
>> =20
>>
>
>
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by:
>SourceForge Enterprise Edition + IBM + LinuxWorld =3D Something 2 See!
>http://www.vasoftware.com=20
>_______________________________________________
>Wrapper-user mailing list
>Wra...@li...=20
>https://lists.sourceforge.net/lists/listinfo/wrapper-user=20
>
> =20
>
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld =3D Something 2 See!
http://www.vasoftware.com=20
_______________________________________________
Wrapper-user mailing list
Wra...@li...=20
https://lists.sourceforge.net/lists/listinfo/wrapper-user
|