[wpkg-users] Assigning a Variable from a Registry key

Stefan Pendl stefan.pendl.71 at gmail.com
Wed Aug 29 14:00:49 CEST 2012


Am 29.08.2012 13:41, schrieb Malte Hohmann:
> To be a bit more precise: I have a package "OracleInstantClient" which
> sets the environment variable ORACLE_HOME using setx.exe utility with
> parameter "-m" (system-wide). This works great. Now I have a second
> package which depends on OracleInstantClient. In this second package I
> need to read the new value of ORACLE_HOME which was set during
> installation of OracleInstantClient, but referecing to %ORACLE_HOME%
> here does not work. So it would be great if WPKG could re-create the
> whole environment variables from scratch on every new package. Maybe
> reading from HKLM\SYSTEM\CurrentControlSet\Control\Session
> Manager\Environment would do...
> However, this could also be achieved by assigning a variable the content
> of a registry key ;o)
>

I think the problem here is that setx.exe doesn't notify the system of 
the change, so cscript.exe doesn't update the process environment.

May be cscript.exe doesn't support updating the process environment at 
all, so wpkg.js must be made aware of that change internally.

----

The OPs question could be solved by a DOS command script using "REG 
QUERY" to read the registry and "FOR /F" to parse the output.


--
Stefan P.

Top-posting:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the wpkg-users mailing list