Changing Path environment variable - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jamaroney3
Posts: 1
Joined: Tue Aug 25, 2009 8:36 pm

Changing Path environment variable

I need to be able to change the system PATH environment variable (i.e.: remove one directory from the system PATH environment variable and add a replacement - or do a search and replace of the PATH variable). I've looked at the "Edit Environment Varible Dialog" but this only allows for the complete replacement, prepend, or append of the variable - I need to replace a part of the variable. The old directory was added manually so uninstalling the application will not help. This is an example:

Current PATH environment variable:
PATH=C:\Program Files\ActiveState Komodo Edit 5\;C:\old dir;C:\Windows\system32;C:\Windows

New PATH should be:
PATH=C:\Program Files\ActiveState Komodo Edit 5\;C:\new dir;C:\Windows\system32;C:\Windows

(of course the actual PATH will be different on any given system)

Anyone with any experience with this?


Thanks;


James Maroney
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Changing Path environment variable

Hi,

For this you can try using a custom action. The custom action will run a script that searches and replaces the string you desire. You can use VBScripts, Java scrips or C++ DLLs.

If you encounter any problems don't hesitate to ask.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”