Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environment path 1

Status
Not open for further replies.

haden

Technical User
Aug 31, 2002
2
DK
Hi

How do I remove a NT Path variable? I insert it into HKEY Local Machine\System\CurrentControlSet\Control\Session Manager\Environment but how do I remove it agian still preserver the others?

TNX
Kim
 
Use a utility like pathman.exe to set and remove path entries, think it is part of NT resource kit
 
You should use Custom Actions to add Environment Variables this can be done from Setep Editor. The advantage Of Doing this is that then you can set it to only install the path or environment variable if it is not there.
 
Tocra is right, make sure on the replacement drop down box you choose the selection "Append at end of current value".
 
Hi
I known how I add the path, but how do I remove it during an uninstall? does anyone have a script example?

 
Haden,

I have had issues with paths not removing properly (usually deletes the entire path value) when using the Features -> Complete (or whatever feature) -> Right Click -> New -> Environment Variable. If you have any component within the feature that have a bad key association you will have problems. Make sure you don't have any "red" errors in your components list and use the following structure in the dialog box for adding an environment:

Name: PATH
Value: [ProgramFilesFolder]My Dir;
Operation: Set value on install and delete on uninstall
Replacement: Append at end - or - insert at beginning
Check the Windows NT/2000/XP system environment variable as appropriate

I also feel more comfortable adding multiple PATH environment variables rather than cramming them into one statement.

This is the proper, supported method for adding/removing environment variables in Windows Installer. You definitely don't want to use the registry to set this environment variable. Some other good examples where a custom action should come into play are the services and hosts files (in system32\drivers\etc), the HKLM\CSS\Services\EventLog\Application\sources (or any REG_MULTI_SZ value), the TNSNAMES.ORA oracle connection file, etc. IOW, any file or value that other programs use to store information should be edited rather than overwritten.

HtH, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
I use this method...

Add a new row to the Environment Table:

Name = *=-Path
Value = [~];ENTER_VALUE_HERE
Environment = PATH
Component = ASSIGN_COMPONENT_HERE

Always install and uninstalls properly.

Hope this Helps,

Steve
 
I use the same method as Steve.....has worked like a charm for me!
 
Steve's method is good. In Wise for Windows Installer 5 environment variables are on the installation expert under features. About time really, Wininstall has had it up front for years.
 
Hello Everyone:

Ive been thrust into the Wise utility and still feeling it
out.

I just tried it myself and it worked here as well!

My question was answere before I even asked.

Thanks! ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top