ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: problem with environment variable
Date Sun, 04 Aug 2002 06:06:16 GMT

----- Original Message -----
From: "Hal Hildebrand (web)" <Hal.Hildebrand@hellblazer.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Monday, July 29, 2002 10:22
Subject: Re: problem with environment variable


> We haven't found a way to do this from the command line, but you can do
this
> with specialized code.
>
> See JRegistryKey:  http://www.beq.ca/tech/Products/jreg_key.shtml
>
> It's easy to use the above to create a custom Ant task which will
permanently
> manipulate the windows registry, such as path and environment variables.
> However, the Ant process executing the task, and any spawned executables
don't
> inherit the environment.  <sigh>  There apparently is some Win32 call
which will
> force an update of the environment variables, but I haven't followed the
bread
> crumbs to find out if there is such a thing.

oh, yes, that might work on some versions of windows, but it is dubious.
Only those winapps listening for the appropriate WM_SETTINGSCHANGED or
listening to a bit of the registry will get the event, as Explorer does, but
command windows dont.

I could see how to do this without JRegistryKey BTW; use <tempfile> to
create a temp file name, fill it with registry stuff in the .reg file
format, then exec regedit against the .reg file.


>
> Another option is to use nested <env> elements:
>
> <exec dir="${basedir}" executable="cmd.exe">
>     <arg line="/c set"/>
>     <env key="test" value="tst" />
> </exec>
>
> It's not elegant, but it works.
>
> ----- Original Message -----
> From: "Dominique Devienne" <DDevienne@lgc.com>
> >
> > There's no problem. This cannot be done. --DD
> >
> > -----Original Message-----
> > From: TINE Houari (OBJECTIVA) [mailto:houari.tine@ca-cedicam.fr] >
> >
> > I has followed the indication given by Tibor Strausz about creation of
> > environment variable from Ant through <exec>.
> >
> > But, it does't work.
> >
> > <exec dir="${basedir}" executable="cmd.exe">
> >   <arg line="/c set test=tst"/>
> > </exec>
> >
> > <exec dir="${basedir}" executable="cmd.exe">
> >   <arg line="/c set"/>
> > </exec>
> >
> > Second task don't print test. What's problem.
> >
> > TINE
> >
> > --
> > To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message