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?
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.
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.-
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.