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

Malte Hohmann groups at daooze.de
Wed Sep 5 13:00:15 CEST 2012


2012/8/29 Stefan Pendl <stefan.pendl.71 at gmail.com>

> 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.
>
>
I am not sure if WPKG updates the environment at all. It saves and restores
its environment during processing of any package - at least this is logged
in the output - so I think it just stores its environment variables
somewhere and reloads them, ignoring any changes done to the system
environment. However, I did not check this in the source code as I have no
clue about JScript. Maybe Rainer could shed some light into this...

----
>
> 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.
>
>
>
This won't do the trick at all as you need to do this query _before_
executing wpkg.js. Same problem as with my issue above...



> --
> 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?
>
> ------------------------------**------------------------------**
> -------------
> wpkg-users mailing list archives >> http://lists.wpkg.org/**
> pipermail/wpkg-users/ <http://lists.wpkg.org/pipermail/wpkg-users/>
> ______________________________**_________________
> wpkg-users mailing list
> wpkg-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/**listinfo/wpkg-users<http://lists.wpkg.org/mailman/listinfo/wpkg-users>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20120905/7b2213dc/attachment-0001.html>


More information about the wpkg-users mailing list