Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Adding Environment Variables


7 replies to this topic

nelly

nelly
  • Members
  • 22 posts

Posted 07 September 2004 - 12:46

Hello ,
Now I'm using func:
EzBatchAddPath (szKey, szPath, szRefDir, nPosition);

for adding the path in
Environment Variables, but this func uses Autoexec.bat for this purpose.

Can you suggest for me something else, something that suitable for every OS.

Thanks in advance!
Nelly.
rolleyes.gif

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 08 September 2004 - 14:37

For NT4/W2K/XP, check out this "Handle PATH Environment on NT" sample.

For Win9x/Me, you'll need to continue to use the Autoexec.bat method.
user posted image

nelly

nelly
  • Members
  • 22 posts

Posted 08 September 2004 - 14:43

Thanks for answering, but I've seen this already,
Itsn't suitable for me becouse the path is being saved as a parameter like %name%, and becouse of it, some programes aren't recognize it.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 09 September 2004 - 02:36

Well you better check it again then because the SetEnvPath call is just appending the supplied szWorkPath parameter value to the Path environmental variable.

'cause the code is pretty straight forward and I basically do the same thing for my own Path adjustments.
user posted image

nelly

nelly
  • Members
  • 22 posts

Posted 13 September 2004 - 12:27

Thank you for replying!
When I use SetEnvPath call , the path is being added, but the rest of the existing path is damaged becouse of it, for example:
The path before:PATH=PATH=D:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Perl\bin\;C:\WINDOWS\system32
;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Borland\StarTeam SDK 6.0\Lib;C:\Program Files\
Microsoft SQL Server\80\Tools\BINN;d:\program files\Program;C:\Program Files\Borland\StarTeam SDK 6.
0\Bin;;

The path after:PATH=D:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Perl\bin\;%SystemRoot%\system32;%S
ystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Borland\StarTeam SDK 6.0\Lib;C:\Program Files
\Microsoft SQL Server\80\Tools\BINN;d:\program files\Program;C:\Program Files\Borland\StarTeam SDK 6
.0\Bin;d:\bea\tuxedo8.1\bin;

===>You should notice that the path after contasins %SystemRoot% instead of C:\WINDOWS


===It seems like I miss something to end the set env

====Please help

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 13 September 2004 - 14:54

No, that's actually working as expected then.

%SystemRoot% is another internal system variable that equates to the Windows installation directory (e.g. C:\WINDOWS).

The actual registry value for the Path is always stored with that other variable, and then populated during bootup with the appropriate runtime value (i.e. %SystemRoot% --> C:\WINDOWS).

To see that in action, just open a Command Prompt and issue the path command.
user posted image

nelly

nelly
  • Members
  • 22 posts

Posted 14 September 2004 - 11:46

Thank you for every thing,
the problem was in nvtype of RegDBSetKeyValueEx:
I should have ensure REGDB_STRING_EXPAND


Thanks again!

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 14 September 2004 - 15:07

I was wondering about that.

Well glad to hear you got it working, and you're welcome.
user posted image